infra
This commit is contained in:
parent
44b2b38dc2
commit
a5ef81d651
@ -22,8 +22,7 @@ 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 -f docker-compose-infra.yaml
|
- docker-compose up -d
|
||||||
- docker stack deploy -c ./docker-compose-deploy.yaml sprint
|
|
||||||
|
|
||||||
deploy-dev:
|
deploy-dev:
|
||||||
extends:
|
extends:
|
||||||
|
@ -13,12 +13,12 @@ services:
|
|||||||
image: mathwave/sprint-repo:sprint
|
image: mathwave/sprint-repo:sprint
|
||||||
restart: always
|
restart: always
|
||||||
environment:
|
environment:
|
||||||
PORT: $PORT
|
PORT: 80
|
||||||
HOST: $HOST
|
HOST: $HOST
|
||||||
debug: "false"
|
debug: "false"
|
||||||
command: ./manage.py runserver 0.0.0.0:$PORT --noreload
|
command: ./manage.py runserver 0.0.0.0:80 --noreload
|
||||||
ports:
|
ports:
|
||||||
- "${PORT}:${PORT}"
|
- "80:80"
|
||||||
deploy:
|
deploy:
|
||||||
mode: replicated
|
mode: replicated
|
||||||
|
|
||||||
|
114
docker-compose.yaml
Normal file
114
docker-compose.yaml
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
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"
|
||||||
|
|
||||||
|
migrations:
|
||||||
|
image: mathwave/sprint-repo:sprint
|
||||||
|
command: ./manage.py migrate
|
||||||
|
depends_on:
|
||||||
|
- postgres
|
||||||
|
|
||||||
|
web:
|
||||||
|
image: mathwave/sprint-repo:sprint
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
PORT: $PORT
|
||||||
|
HOST: $HOST
|
||||||
|
debug: "false"
|
||||||
|
command: ./manage.py runserver 0.0.0.0:$PORT --noreload
|
||||||
|
ports:
|
||||||
|
- "${PORT}:${PORT}"
|
||||||
|
depends_on:
|
||||||
|
- migrations
|
||||||
|
- 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:
|
||||||
|
image: mathwave/sprint-repo:sprint
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
HOST: $HOST
|
||||||
|
command: ./manage.py bot
|
||||||
|
depends_on:
|
||||||
|
- web
|
||||||
|
|
||||||
|
loop:
|
||||||
|
image: mathwave/sprint-repo:sprint
|
||||||
|
restart: always
|
||||||
|
environment:
|
||||||
|
HOST: $HOST
|
||||||
|
command: ./manage.py loop
|
||||||
|
depends_on:
|
||||||
|
- web
|
||||||
|
|
||||||
|
rabbitmq:
|
||||||
|
restart: always
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: dockerfiles/rabbitmq/Dockerfile
|
||||||
|
ports:
|
||||||
|
- "15672:15672"
|
||||||
|
- "5672:5672"
|
||||||
|
|
||||||
|
worker:
|
||||||
|
restart: always
|
||||||
|
image: mathwave/sprint-repo:sprint
|
||||||
|
privileged: true
|
||||||
|
command: ./manage.py receive
|
||||||
|
environment:
|
||||||
|
SOLUTIONS_ROOT_EXTERNAL: "${SOLUTIONS_ROOT_EXTERNAL}"
|
||||||
|
HOST: $HOST
|
||||||
|
depends_on:
|
||||||
|
- web
|
||||||
|
- rabbitmq
|
||||||
|
- migrations
|
||||||
|
- storage
|
||||||
|
volumes:
|
||||||
|
- /sprint-data/solutions:/usr/src/app/solutions
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
|
|
||||||
|
apply-languages:
|
||||||
|
image: mathwave/sprint-repo:sprint
|
||||||
|
command: ./manage.py apply_languages
|
||||||
|
depends_on:
|
||||||
|
- migrations
|
||||||
|
- web
|
||||||
|
- postgres
|
||||||
|
|
||||||
|
notify-admin:
|
||||||
|
image: mathwave/sprint-repo:sprint
|
||||||
|
command: ./manage.py success_deploy
|
||||||
|
depends_on:
|
||||||
|
- migrations
|
||||||
|
- web
|
||||||
|
- worker
|
||||||
|
- storage
|
||||||
|
- rabbitmq
|
||||||
|
- bot
|
||||||
|
- postgres
|
||||||
|
- apply-languages
|
||||||
|
- loop
|
Loading…
Reference in New Issue
Block a user