infra
This commit is contained in:
parent
9297b0605f
commit
44b2b38dc2
@ -22,7 +22,8 @@ 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 --scale worker=4
|
- docker-compose up -d -f docker-compose-infra.yaml
|
||||||
|
- docker stack deploy -c ./docker-compose-deploy.yaml sprint
|
||||||
|
|
||||||
deploy-dev:
|
deploy-dev:
|
||||||
extends:
|
extends:
|
||||||
|
@ -1,27 +1,13 @@
|
|||||||
version: "3"
|
version: "3.2"
|
||||||
|
|
||||||
|
|
||||||
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"
|
|
||||||
|
|
||||||
migrations:
|
migrations:
|
||||||
image: mathwave/sprint-repo:sprint
|
image: mathwave/sprint-repo:sprint
|
||||||
command: ./manage.py migrate
|
command: ./manage.py migrate
|
||||||
depends_on:
|
deploy:
|
||||||
- postgres
|
mode: replicated
|
||||||
|
|
||||||
web:
|
web:
|
||||||
image: mathwave/sprint-repo:sprint
|
image: mathwave/sprint-repo:sprint
|
||||||
@ -33,19 +19,8 @@ services:
|
|||||||
command: ./manage.py runserver 0.0.0.0:$PORT --noreload
|
command: ./manage.py runserver 0.0.0.0:$PORT --noreload
|
||||||
ports:
|
ports:
|
||||||
- "${PORT}:${PORT}"
|
- "${PORT}:${PORT}"
|
||||||
depends_on:
|
deploy:
|
||||||
- migrations
|
mode: replicated
|
||||||
- rabbitmq
|
|
||||||
- storage
|
|
||||||
|
|
||||||
storage:
|
|
||||||
restart: always
|
|
||||||
image: mathwave/sprint-repo:sprint
|
|
||||||
command: ./manage.py storage
|
|
||||||
ports:
|
|
||||||
- "5555:5555"
|
|
||||||
volumes:
|
|
||||||
- /sprint-data/data:/usr/src/app/data
|
|
||||||
|
|
||||||
bot:
|
bot:
|
||||||
image: mathwave/sprint-repo:sprint
|
image: mathwave/sprint-repo:sprint
|
||||||
@ -55,6 +30,8 @@ services:
|
|||||||
command: ./manage.py bot
|
command: ./manage.py bot
|
||||||
depends_on:
|
depends_on:
|
||||||
- web
|
- web
|
||||||
|
deploy:
|
||||||
|
mode: replicated
|
||||||
|
|
||||||
loop:
|
loop:
|
||||||
image: mathwave/sprint-repo:sprint
|
image: mathwave/sprint-repo:sprint
|
||||||
@ -64,15 +41,8 @@ services:
|
|||||||
command: ./manage.py loop
|
command: ./manage.py loop
|
||||||
depends_on:
|
depends_on:
|
||||||
- web
|
- web
|
||||||
|
deploy:
|
||||||
rabbitmq:
|
mode: replicated
|
||||||
restart: always
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: dockerfiles/rabbitmq/Dockerfile
|
|
||||||
ports:
|
|
||||||
- "15672:15672"
|
|
||||||
- "5672:5672"
|
|
||||||
|
|
||||||
worker:
|
worker:
|
||||||
restart: always
|
restart: always
|
||||||
@ -84,20 +54,21 @@ services:
|
|||||||
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
|
||||||
|
deploy:
|
||||||
|
mode: replicated
|
||||||
|
replicas: 4
|
||||||
|
|
||||||
apply-languages:
|
apply-languages:
|
||||||
image: mathwave/sprint-repo:sprint
|
image: mathwave/sprint-repo:sprint
|
||||||
command: ./manage.py apply_languages
|
command: ./manage.py apply_languages
|
||||||
depends_on:
|
depends_on:
|
||||||
- migrations
|
- migrations
|
||||||
- web
|
deploy:
|
||||||
- postgres
|
mode: replicated
|
||||||
|
|
||||||
notify-admin:
|
notify-admin:
|
||||||
image: mathwave/sprint-repo:sprint
|
image: mathwave/sprint-repo:sprint
|
||||||
@ -106,9 +77,8 @@ services:
|
|||||||
- migrations
|
- migrations
|
||||||
- web
|
- web
|
||||||
- worker
|
- worker
|
||||||
- storage
|
|
||||||
- rabbitmq
|
|
||||||
- bot
|
- bot
|
||||||
- postgres
|
|
||||||
- apply-languages
|
- apply-languages
|
||||||
- loop
|
- loop
|
||||||
|
deploy:
|
||||||
|
mode: replicated
|
36
docker-compose-infra.yaml
Normal file
36
docker-compose-infra.yaml
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
|
||||||
|
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"
|
||||||
|
|
||||||
|
storage:
|
||||||
|
restart: always
|
||||||
|
image: mathwave/sprint-repo:sprint
|
||||||
|
command: ./manage.py storage
|
||||||
|
ports:
|
||||||
|
- "5555:5555"
|
||||||
|
volumes:
|
||||||
|
- /sprint-data/data:/usr/src/app/data
|
||||||
|
|
||||||
|
rabbitmq:
|
||||||
|
restart: always
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: dockerfiles/rabbitmq/Dockerfile
|
||||||
|
ports:
|
||||||
|
- "15672:15672"
|
||||||
|
- "5672:5672"
|
Loading…
Reference in New Issue
Block a user