mirror of
https://github.com/aykhans/series-robot-web.git
synced 2025-04-16 04:53:11 +00:00
90 lines
2.4 KiB
YAML
90 lines
2.4 KiB
YAML
version: "3.9"
|
|
|
|
services:
|
|
db:
|
|
image: postgres
|
|
volumes:
|
|
- dbdata:/var/lib/postgresql/data
|
|
env_file:
|
|
- ../../config/db/databasepostgresql_env
|
|
|
|
rabbitmq:
|
|
image: rabbitmq
|
|
|
|
django:
|
|
restart: always
|
|
environment:
|
|
- DJANGO_SETTINGS_MODULE=config.settings.production
|
|
build:
|
|
context: ../../
|
|
dockerfile: Docker/Prod/Dockerfile
|
|
command: >
|
|
bash -c "cd src
|
|
&& python3 manage.py makemigrations account
|
|
&& python3 manage.py makemigrations series
|
|
&& echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ makemigrations completed ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
|
|
&& python3 manage.py migrate
|
|
&& echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ migrate completed ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
|
|
&& python3 manage.py collectstatic --noinput
|
|
&& echo '~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ collectstatic completed ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~'
|
|
&& gunicorn --bind 0.0.0.0:8000 config.wsgi"
|
|
ports:
|
|
- "8000:8000"
|
|
depends_on:
|
|
- db
|
|
- rabbitmq
|
|
volumes:
|
|
- static_volume:/django_static
|
|
|
|
celery-worker:
|
|
restart: always
|
|
build:
|
|
context: ../../
|
|
dockerfile: Docker/Prod/Dockerfile
|
|
environment:
|
|
- DJANGO_SETTINGS_MODULE=config.settings.production
|
|
command: >
|
|
bash -c "cd src
|
|
&& celery -A config worker -l info -f worker.log"
|
|
depends_on:
|
|
- django
|
|
|
|
celery-beat:
|
|
restart: always
|
|
build:
|
|
context: ../../
|
|
dockerfile: Docker/Prod/Dockerfile
|
|
environment:
|
|
- DJANGO_SETTINGS_MODULE=config.settings.production
|
|
command: >
|
|
bash -c "cd src
|
|
&& celery -A config beat -l info -f beat.log"
|
|
depends_on:
|
|
- celery-worker
|
|
|
|
nginx:
|
|
image: nginx
|
|
ports:
|
|
- "80:80"
|
|
- "443:443"
|
|
volumes:
|
|
- ../../config/nginx/server.conf:/etc/nginx/conf.d/default.conf:ro
|
|
- ../../config/certbot/conf:/etc/letsencrypt
|
|
- ../../config/certbot/www:/var/www/certbot
|
|
- static_volume:/django_static
|
|
depends_on:
|
|
- django
|
|
command: "/bin/sh -c 'while :; do sleep 6h & wait $${!}; nginx -s reload; done & nginx -g \"daemon off;\"'"
|
|
|
|
certbot:
|
|
image: certbot/certbot
|
|
volumes:
|
|
- ../../config/certbot/conf:/etc/letsencrypt
|
|
- ../../config/certbot/www:/var/www/certbot
|
|
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
|
|
|
|
#TODO: add volume for celery logs
|
|
volumes:
|
|
dbdata:
|
|
static_volume:
|