ConceptPortal-public/docker-compose-prod.yml

78 lines
1.6 KiB
YAML
Raw Normal View History

2023-07-15 17:46:19 +03:00
volumes:
postgres_volume:
2023-08-08 16:14:58 +03:00
name: "postgresql-db"
2023-07-15 17:46:19 +03:00
django_static_volume:
2023-08-08 16:14:58 +03:00
name: "static"
2023-07-15 17:46:19 +03:00
django_media_volume:
2023-08-08 16:14:58 +03:00
name: "media"
2023-07-15 17:46:19 +03:00
networks:
default:
name: concept-api-net
2023-08-08 15:33:23 +03:00
secrets:
django_key:
file: ./secrets/django_key.txt
db_password:
file: ./secrets/db_password.txt
2023-07-15 17:46:19 +03:00
services:
frontend:
restart: always
depends_on:
- backend
build:
context: ./rsconcept/frontend
ports:
- 3000:3000
command: serve -s /home/node -l 3000
backend:
restart: always
depends_on:
- postgresql-db
2023-08-08 15:33:23 +03:00
secrets:
- db_password
- django_key
2023-07-15 17:46:19 +03:00
build:
context: ./rsconcept/backend
2023-08-08 15:33:23 +03:00
env_file: ./rsconcept/backend/.env.prod
environment:
SECRET_KEY: /run/secrets/django_key
DB_PASSWORD: /run/secrets/db_password
2023-08-08 18:14:30 +03:00
expose:
- 8000
2023-07-15 17:46:19 +03:00
volumes:
- django_static_volume:/home/app/web/static
- django_media_volume:/home/app/web/media
command:
gunicorn -w 3 project.wsgi --bind 0.0.0.0:8000
postgresql-db:
restart: always
image: postgres:alpine
2023-08-08 15:33:23 +03:00
secrets:
- db_password
env_file: ./postgresql/.env.prod
environment:
POSTGRES_PASSWORD: /run/secrets/db_password
2023-07-15 17:46:19 +03:00
volumes:
- postgres_volume:/var/lib/postgresql/data
nginx:
restart: always
build:
context: ./nginx
ports:
2023-08-08 18:14:30 +03:00
- 8000:80
depends_on:
- backend
2023-07-15 17:46:19 +03:00
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
volumes:
- django_static_volume:/var/www/static
- django_media_volume:/var/www/media