ConceptPortal-public/docker-compose-prod.yml

84 lines
1.8 KiB
YAML
Raw Normal View History

2023-08-11 16:04:26 +03:00
name: concept-portal
2023-07-15 17:46:19 +03:00
volumes:
postgres_volume:
2023-08-11 16:04:26 +03:00
name: "portal-data"
2023-07-15 17:46:19 +03:00
django_static_volume:
2023-08-11 16:04:26 +03:00
name: "portal-static"
2023-07-15 17:46:19 +03:00
django_media_volume:
2023-08-11 16:04:26 +03:00
name: "portal-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:
2023-08-11 16:04:26 +03:00
container_name: portal-frontend
2023-07-15 17:46:19 +03:00
restart: always
depends_on:
- backend
build:
context: ./rsconcept/frontend
2023-08-09 16:55:53 +03:00
expose:
- 3000
2023-07-15 17:46:19 +03:00
command: serve -s /home/node -l 3000
backend:
2023-08-11 16:04:26 +03:00
container_name: portal-backend
2023-07-15 17:46:19 +03:00
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:
2023-08-11 16:04:26 +03:00
container_name: portal-db
2023-07-15 17:46:19 +03:00
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:
2023-08-11 16:04:26 +03:00
container_name: portal-router
2023-07-15 17:46:19 +03:00
restart: always
build:
context: ./nginx
ports:
2023-08-09 16:55:53 +03:00
- 8000:8000
- 3000:3000
2023-08-08 18:14:30 +03:00
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