rename docker-compose.prod

This commit is contained in:
Daniel afx 2022-02-04 13:48:46 +00:00
parent 53dab29f12
commit 6ad34a779c
3 changed files with 86 additions and 86 deletions

29
docker-compose.dev.yml Normal file
View file

@ -0,0 +1,29 @@
version: '3'
services:
flask:
build: ./flask
command: python manage.py run -h 0.0.0.0
volumes:
- ./flask/:/usr/src/app/
ports:
- 5000:5000
env_file:
- ./.env.dev
depends_on:
- db
db:
image: postgres:13-alpine
volumes:
- postgres_data:/var/lib/postgresql/data/
env_file:
- ./.env.dev
swagger:
image: swaggerapi/swagger-editor
volumes:
- ./swagger.json:/swagger.json
ports:
- "80:8080"
volumes:
postgres_data:

View file

@ -1,69 +0,0 @@
version: '3'
services:
lb:
image: haproxy:latest
ports:
- "80:80"
- "443:443"
volumes:
- "./data/certificates:/certificates"
- "./lb:/usr/local/etc/haproxy"
depends_on:
- "certbot"
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;'"
flask:
build:
context: ./flask
dockerfile: Dockerfile.prod
command: gunicorn --bind 0.0.0.0:5000 manage:app
expose:
- 5000
env_file:
- ./.env.prod
networks:
- internal
depends_on:
- db
db:
image: postgres:13-alpine
volumes:
- "./data/db/pgdata:/var/lib/postgresql/data/"
env_file:
- ./.env.prod
networks:
- internal
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"
volumes:
- "./data/osmtile/pgdata:/var/lib/postgresql/12/main"
networks:
- internal
#entrypoint: "/run.sh import"
entrypoint: "/run.sh run"
restart: always
networks:
internal: {}

View file

@ -1,29 +1,69 @@
version: '3' version: '3'
services: services:
flask: lb:
build: ./flask image: haproxy:latest
command: python manage.py run -h 0.0.0.0
volumes:
- ./flask/:/usr/src/app/
ports: ports:
- 5000:5000 - "80:80"
- "443:443"
volumes:
- "./data/certificates:/certificates"
- "./lb:/usr/local/etc/haproxy"
depends_on:
- "certbot"
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;'"
flask:
build:
context: ./flask
dockerfile: Dockerfile.prod
command: gunicorn --bind 0.0.0.0:5000 manage:app
expose:
- 5000
env_file: env_file:
- ./.env.dev - ./.env.prod
networks:
- internal
depends_on: depends_on:
- db - db
db: db:
image: postgres:13-alpine image: postgres:13-alpine
volumes: volumes:
- postgres_data:/var/lib/postgresql/data/ - "./data/db/pgdata:/var/lib/postgresql/data/"
env_file: env_file:
- ./.env.dev - ./.env.prod
swagger: networks:
image: swaggerapi/swagger-editor - internal
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"
volumes: volumes:
- ./swagger.json:/swagger.json - "./data/osmtile/pgdata:/var/lib/postgresql/12/main"
ports: networks:
- "80:8080" - internal
#entrypoint: "/run.sh import"
volumes: entrypoint: "/run.sh run"
postgres_data: restart: always
networks:
internal: {}