This commit is contained in:
Egor Matveev 2022-03-02 23:29:59 +03:00
parent 8c08ffcc77
commit 6d17f7237b
2 changed files with 68 additions and 6 deletions

View File

@ -22,9 +22,9 @@ build:
# - docker image rm mathwave/sprint-repo:sprint # - docker image rm mathwave/sprint-repo:sprint
# - docker pull mathwave/sprint-repo:sprint # - docker pull mathwave/sprint-repo:sprint
script: script:
- docker-compose up -d # - docker-compose up -d
# - docker-compose -f docker-compose-infra.yaml up -d # - docker-compose -f docker-compose-infra.yaml up -d
# - docker stack deploy -c ./docker-compose-deploy.yaml sprint - docker stack deploy -c ./docker-compose-deploy.yaml sprint
deploy-dev: deploy-dev:
extends: extends:

View File

@ -1,11 +1,31 @@
version: "3.2" version: "3"
services: services:
postgres:
restart: always
build:
context: .
dockerfile: dockerfiles/postgres/Dockerfile
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: $POSTGRES_PASSWORD
POSTGRES_DB: sprint
volumes:
- /sprint-data/postgres-data:/var/lib/postgresql/data
ports:
- "5432:5432"
deploy:
mode: replicated
restart_policy:
condition: on-failure
migrations: migrations:
image: mathwave/sprint-repo:sprint image: mathwave/sprint-repo:sprint
command: ./manage.py migrate command: ./manage.py migrate
depends_on:
- postgres
deploy: deploy:
mode: replicated mode: replicated
restart_policy: restart_policy:
@ -13,13 +33,31 @@ services:
web: web:
image: mathwave/sprint-repo:sprint image: mathwave/sprint-repo:sprint
restart: always
environment: environment:
PORT: 80 PORT: $PORT
HOST: $HOST HOST: $HOST
debug: "false" debug: "false"
command: ./manage.py runserver 0.0.0.0:80 --noreload command: ./manage.py runserver 0.0.0.0:$PORT --noreload
ports: ports:
- "80:80" - "${PORT}:${PORT}"
depends_on:
- migrations
- rabbitmq
- storage
deploy:
mode: replicated
restart_policy:
condition: on-failure
storage:
restart: always
image: mathwave/sprint-repo:sprint
command: ./manage.py storage
ports:
- "5555:5555"
volumes:
- /sprint-data/data:/usr/src/app/data
deploy: deploy:
mode: replicated mode: replicated
restart_policy: restart_policy:
@ -27,6 +65,7 @@ services:
bot: bot:
image: mathwave/sprint-repo:sprint image: mathwave/sprint-repo:sprint
restart: always
environment: environment:
HOST: $HOST HOST: $HOST
command: ./manage.py bot command: ./manage.py bot
@ -39,6 +78,7 @@ services:
loop: loop:
image: mathwave/sprint-repo:sprint image: mathwave/sprint-repo:sprint
restart: always
environment: environment:
HOST: $HOST HOST: $HOST
command: ./manage.py loop command: ./manage.py loop
@ -49,15 +89,32 @@ services:
restart_policy: restart_policy:
condition: on-failure condition: on-failure
rabbitmq:
restart: always
build:
context: .
dockerfile: dockerfiles/rabbitmq/Dockerfile
ports:
- "15672:15672"
- "5672:5672"
deploy:
mode: replicated
restart_policy:
condition: on-failure
worker: worker:
restart: always
image: mathwave/sprint-repo:sprint image: mathwave/sprint-repo:sprint
privileged: true
command: ./manage.py receive command: ./manage.py receive
environment: environment:
SOLUTIONS_ROOT_EXTERNAL: "${SOLUTIONS_ROOT_EXTERNAL}" SOLUTIONS_ROOT_EXTERNAL: "${SOLUTIONS_ROOT_EXTERNAL}"
HOST: $HOST HOST: $HOST
depends_on: depends_on:
- web - web
- rabbitmq
- migrations - migrations
- storage
volumes: volumes:
- /sprint-data/solutions:/usr/src/app/solutions - /sprint-data/solutions:/usr/src/app/solutions
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock
@ -72,6 +129,8 @@ services:
command: ./manage.py apply_languages command: ./manage.py apply_languages
depends_on: depends_on:
- migrations - migrations
- web
- postgres
deploy: deploy:
mode: replicated mode: replicated
restart_policy: restart_policy:
@ -84,7 +143,10 @@ services:
- migrations - migrations
- web - web
- worker - worker
- storage
- rabbitmq
- bot - bot
- postgres
- apply-languages - apply-languages
- loop - loop
deploy: deploy: