mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-25 12:30:37 +03:00
111 lines
2.6 KiB
YAML
111 lines
2.6 KiB
YAML
name: concept-portal
|
|
|
|
volumes:
|
|
postgres_volume:
|
|
name: "portal-data"
|
|
django_static_volume:
|
|
name: "portal-static"
|
|
django_media_volume:
|
|
name: "portal-media"
|
|
cerbot_www_volume:
|
|
name: "portal-certbot-serve"
|
|
cerbot_conf_volume:
|
|
name: "portal-certbot-config"
|
|
|
|
networks:
|
|
default:
|
|
name: concept-api-net
|
|
|
|
secrets:
|
|
django_key:
|
|
file: ./secrets/django_key.txt
|
|
db_password:
|
|
file: ./secrets/db_password.txt
|
|
email_host:
|
|
file: ./secrets/email_host.txt
|
|
email_user:
|
|
file: ./secrets/email_user.txt
|
|
email_password:
|
|
file: ./secrets/email_password.txt
|
|
|
|
services:
|
|
frontend:
|
|
container_name: portal-frontend
|
|
restart: always
|
|
depends_on:
|
|
- backend
|
|
build:
|
|
context: ./rsconcept/frontend
|
|
args:
|
|
BUILD_TYPE: production
|
|
expose:
|
|
- 3000
|
|
command: serve -s /home/node -l 3000
|
|
|
|
backend:
|
|
container_name: portal-backend
|
|
restart: always
|
|
depends_on:
|
|
- postgresql-db
|
|
secrets:
|
|
- db_password
|
|
- django_key
|
|
- email_host
|
|
- email_user
|
|
- email_password
|
|
build:
|
|
context: ./rsconcept/backend
|
|
env_file: ./rsconcept/backend/.env.prod
|
|
environment:
|
|
SECRET_KEY: /run/secrets/django_key
|
|
DB_PASSWORD: /run/secrets/db_password
|
|
EMAIL_HOST: /run/secrets/email_host
|
|
EMAIL_HOST_USER: /run/secrets/email_user
|
|
EMAIL_HOST_PASSWORD: /run/secrets/email_password
|
|
expose:
|
|
- 8000
|
|
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:
|
|
container_name: portal-db
|
|
restart: always
|
|
image: postgres:16-alpine
|
|
secrets:
|
|
- db_password
|
|
env_file: ./postgresql/.env.prod
|
|
environment:
|
|
POSTGRES_PASSWORD_FILE: /run/secrets/db_password
|
|
volumes:
|
|
- postgres_volume:/var/lib/postgresql/data
|
|
|
|
certbot:
|
|
container_name: portal-certbot
|
|
restart: no
|
|
image: certbot/certbot:latest
|
|
volumes:
|
|
- cerbot_www_volume:/var/www/certbot/:rw
|
|
- cerbot_conf_volume:/etc/letsencrypt/:rw
|
|
|
|
nginx:
|
|
container_name: portal-router
|
|
restart: always
|
|
build:
|
|
context: ./nginx
|
|
args:
|
|
BUILD_TYPE: production
|
|
ports:
|
|
- 80:80
|
|
- 443:443
|
|
depends_on:
|
|
- backend
|
|
- frontend
|
|
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
|
|
- cerbot_www_volume:/var/www/certbot/:ro
|
|
- cerbot_conf_volume:/etc/nginx/ssl/:ro
|