246 lines
5.7 KiB
YAML
246 lines
5.7 KiB
YAML
version: "3.4"
|
|
|
|
|
|
services:
|
|
|
|
postgres:
|
|
image: postgres
|
|
environment:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_PASSWORD: $DB_PASSWORD
|
|
POSTGRES_DB: sprint
|
|
volumes:
|
|
- /sprint-data/postgres-data:/var/lib/postgresql/data
|
|
# - ./pg_hba.conf:/var/lib/postgresql/data/pg_hba.conf
|
|
networks:
|
|
- net
|
|
deploy:
|
|
mode: replicated
|
|
restart_policy:
|
|
condition: on-failure
|
|
update_config:
|
|
parallelism: 1
|
|
order: start-first
|
|
|
|
migrations:
|
|
image: mathwave/sprint-repo:sprint
|
|
command: ./manage.py migrate
|
|
networks:
|
|
- net
|
|
environment:
|
|
SOLUTIONS_ROOT_EXTERNAL: "/sprint-data/data/solutions"
|
|
DB_PASSWORD: $DB_PASSWORD
|
|
DEBUG: $DEBUG
|
|
TELEGRAM_TOKEN: $TELEGRAM_TOKEN
|
|
deploy:
|
|
mode: replicated
|
|
restart_policy:
|
|
condition: on-failure
|
|
|
|
collect_static:
|
|
image: mathwave/sprint-repo:sprint
|
|
networks:
|
|
- net
|
|
environment:
|
|
SOLUTIONS_ROOT_EXTERNAL: "/sprint-data/data/solutions"
|
|
DB_PASSWORD: $DB_PASSWORD
|
|
DEBUG: $DEBUG
|
|
TELEGRAM_TOKEN: $TELEGRAM_TOKEN
|
|
volumes:
|
|
- /sprint-data/static:/usr/src/app/static
|
|
command: ./manage.py collectstatic --noinput
|
|
deploy:
|
|
mode: replicated
|
|
restart_policy:
|
|
condition: on-failure
|
|
|
|
web:
|
|
image: mathwave/sprint-repo:sprint
|
|
networks:
|
|
- net
|
|
environment:
|
|
SOLUTIONS_ROOT_EXTERNAL: "/sprint-data/data/solutions"
|
|
DB_PASSWORD: $DB_PASSWORD
|
|
DEBUG: $DEBUG
|
|
TELEGRAM_TOKEN: $TELEGRAM_TOKEN
|
|
volumes:
|
|
- /sprint-data/static:/usr/src/app/static
|
|
command: ./manage.py runserver 0.0.0.0:80 --noreload --insecure
|
|
ports:
|
|
- "80:80"
|
|
deploy:
|
|
mode: replicated
|
|
restart_policy:
|
|
condition: on-failure
|
|
update_config:
|
|
parallelism: 1
|
|
order: start-first
|
|
|
|
storage:
|
|
image: mathwave/sprint-repo:sprint
|
|
networks:
|
|
- net
|
|
command: ./manage.py storage
|
|
environment:
|
|
SOLUTIONS_ROOT_EXTERNAL: "/sprint-data/data/solutions"
|
|
DB_PASSWORD: $DB_PASSWORD
|
|
DEBUG: $DEBUG
|
|
TELEGRAM_TOKEN: $TELEGRAM_TOKEN
|
|
volumes:
|
|
- /sprint-data/data:/usr/src/app/data
|
|
deploy:
|
|
mode: replicated
|
|
restart_policy:
|
|
condition: on-failure
|
|
update_config:
|
|
parallelism: 1
|
|
order: start-first
|
|
|
|
health_check:
|
|
image: mathwave/sprint-repo:sprint
|
|
networks:
|
|
- net
|
|
command: ./manage.py health_check
|
|
environment:
|
|
SOLUTIONS_ROOT_EXTERNAL: "/sprint-data/data/solutions"
|
|
DB_PASSWORD: $DB_PASSWORD
|
|
DEBUG: $DEBUG
|
|
TELEGRAM_TOKEN: $TELEGRAM_TOKEN
|
|
deploy:
|
|
mode: replicated
|
|
restart_policy:
|
|
condition: on-failure
|
|
update_config:
|
|
parallelism: 1
|
|
order: start-first
|
|
|
|
bot:
|
|
image: mathwave/sprint-repo:sprint
|
|
networks:
|
|
- net
|
|
environment:
|
|
SOLUTIONS_ROOT_EXTERNAL: "/sprint-data/data/solutions"
|
|
DB_PASSWORD: $DB_PASSWORD
|
|
DEBUG: $DEBUG
|
|
TELEGRAM_TOKEN: $TELEGRAM_TOKEN
|
|
command: ./manage.py bot
|
|
deploy:
|
|
mode: replicated
|
|
restart_policy:
|
|
condition: on-failure
|
|
update_config:
|
|
parallelism: 1
|
|
order: stop-first
|
|
|
|
loop:
|
|
image: mathwave/sprint-repo:sprint
|
|
networks:
|
|
- net
|
|
environment:
|
|
SOLUTIONS_ROOT_EXTERNAL: "/sprint-data/data/solutions"
|
|
DB_PASSWORD: $DB_PASSWORD
|
|
DEBUG: $DEBUG
|
|
TELEGRAM_TOKEN: $TELEGRAM_TOKEN
|
|
command: ./manage.py loop
|
|
deploy:
|
|
mode: replicated
|
|
restart_policy:
|
|
condition: on-failure
|
|
update_config:
|
|
parallelism: 1
|
|
order: stop-first
|
|
|
|
rabbitmq:
|
|
image: rabbitmq:3.7.9-management
|
|
ports:
|
|
- "15672:15672"
|
|
- "5672:5672"
|
|
networks:
|
|
- net
|
|
deploy:
|
|
mode: replicated
|
|
restart_policy:
|
|
condition: on-failure
|
|
update_config:
|
|
parallelism: 1
|
|
order: start-first
|
|
|
|
worker:
|
|
image: mathwave/sprint-repo:sprint
|
|
networks:
|
|
- net
|
|
command: ./manage.py receive
|
|
environment:
|
|
SOLUTIONS_ROOT_EXTERNAL: "/sprint-data/data/solutions"
|
|
DB_PASSWORD: $DB_PASSWORD
|
|
DEBUG: $DEBUG
|
|
TELEGRAM_TOKEN: $TELEGRAM_TOKEN
|
|
volumes:
|
|
- /sprint-data/solutions:/usr/src/app/solutions
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
deploy:
|
|
mode: replicated
|
|
replicas: 4
|
|
restart_policy:
|
|
condition: on-failure
|
|
update_config:
|
|
parallelism: 1
|
|
order: start-first
|
|
|
|
file_generator:
|
|
image: mathwave/sprint-repo:sprint
|
|
networks:
|
|
- net
|
|
command: ./manage.py file_generator
|
|
environment:
|
|
SOLUTIONS_ROOT_EXTERNAL: "/sprint-data/data/solutions"
|
|
DB_PASSWORD: $DB_PASSWORD
|
|
DEBUG: $DEBUG
|
|
TELEGRAM_TOKEN: $TELEGRAM_TOKEN
|
|
deploy:
|
|
mode: replicated
|
|
replicas: 1
|
|
restart_policy:
|
|
condition: on-failure
|
|
update_config:
|
|
parallelism: 1
|
|
order: start-first
|
|
|
|
notification_manager:
|
|
image: mathwave/sprint-repo:sprint
|
|
networks:
|
|
- net
|
|
command: ./manage.py notification_manager
|
|
environment:
|
|
SOLUTIONS_ROOT_EXTERNAL: "/sprint-data/data/solutions"
|
|
DB_PASSWORD: $DB_PASSWORD
|
|
DEBUG: $DEBUG
|
|
TELEGRAM_TOKEN: $TELEGRAM_TOKEN
|
|
deploy:
|
|
mode: replicated
|
|
replicas: 1
|
|
restart_policy:
|
|
condition: on-failure
|
|
update_config:
|
|
parallelism: 1
|
|
order: start-first
|
|
|
|
apply-languages:
|
|
image: mathwave/sprint-repo:sprint
|
|
networks:
|
|
- net
|
|
command: ./manage.py apply_languages
|
|
environment:
|
|
SOLUTIONS_ROOT_EXTERNAL: "/sprint-data/data/solutions"
|
|
DB_PASSWORD: $DB_PASSWORD
|
|
DEBUG: $DEBUG
|
|
TELEGRAM_TOKEN: $TELEGRAM_TOKEN
|
|
deploy:
|
|
mode: replicated
|
|
restart_policy:
|
|
condition: on-failure
|
|
|
|
networks:
|
|
net:
|
|
driver: overlay
|