net/docker-compose.yml

84 lines
1.9 KiB
YAML
Raw Normal View History

2022-02-04 08:18:46 -05:00
version: '3'
2022-02-03 16:47:32 -05:00
services:
2022-02-04 08:48:46 -05:00
lb:
image: haproxy:latest
2022-02-03 16:47:32 -05:00
ports:
2022-02-04 08:48:46 -05:00
- "80:80"
- "443:443"
volumes:
- "./data/certificates:/certificates"
- "./lb:/usr/local/etc/haproxy"
depends_on:
- "certbot"
2022-02-04 10:16:42 -05:00
- "flask"
- "osmtile"
2022-02-04 08:48:46 -05:00
restart: always
networks:
- internal
labels:
- meta.role=lb
certbot:
image: "certbot/certbot"
hostname: certbot
volumes:
- "./data/certificates:/certificates"
- "./data/certbot/etc:/etc/letsencrypt"
- "./data/certbot/var:/var/lib/letsencrypt"
- "./logs/certbot:/var/log/letsencrypt"
restart: on-failure
networks:
- internal
labels:
- meta.role=certbot
#entrypoint: sh -c 'while true; do sleep 1; done'
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 15d & wait $${!}; done;'"
2022-02-05 20:18:30 -05:00
db:
image: postgres:13-alpine
volumes:
- "./data/db/pgdata:/var/lib/postgresql/data/"
env_file:
- ./.env.prod
restart: always
networks:
- internal
pgadmin:
image: dpage/pgadmin4
2022-02-05 21:44:43 -05:00
#volumes:
2022-02-06 22:17:11 -05:00
# - "./data/dbadmin:/var/lib/pgadmin"
2022-02-05 20:18:30 -05:00
env_file:
- ./.env.prod
restart: always
networks:
- internal
depends_on:
- db
2022-02-04 08:48:46 -05:00
flask:
build:
context: ./flask
dockerfile: Dockerfile.prod
command: gunicorn --bind 0.0.0.0:5000 manage:app
expose:
- 5000
2022-02-03 16:47:32 -05:00
env_file:
2022-02-04 08:48:46 -05:00
- ./.env.prod
networks:
- internal
2022-02-03 16:47:32 -05:00
depends_on:
- db
2022-02-04 08:48:46 -05:00
osmtile:
image: "overv/openstreetmap-tile-server:latest"
hostname: osmtile
environment:
- "DOWNLOAD_PBF=https://download.geofabrik.de/europe/bulgaria-latest.osm.pbf"
- "DOWNLOAD_POLY=https://download.geofabrik.de/europe/bulgaria.poly"
2022-02-03 18:53:53 -05:00
volumes:
2022-02-04 10:33:49 -05:00
- "./data/osmtile/pgdata:/var/lib/postgresql/12/main"
2022-02-04 08:48:46 -05:00
networks:
- internal
#entrypoint: "/run.sh import"
entrypoint: "/run.sh run"
restart: always
networks:
internal: {}