Merge pull request 'master' (#11) from master into dev

Reviewed-on: #11
This commit is contained in:
emmatveev 2024-11-23 22:24:10 +03:00
commit db1c1a7140
5 changed files with 5 additions and 49 deletions

View File

@ -2,30 +2,13 @@ version: "3.4"
services:
queues-nginx:
image: mathwave/sprint-repo:queues
networks:
- common-infra-nginx
environment:
MONGO_HOST: "mongo.develop.sprinthub.ru"
MONGO_PASSWORD: $MONGO_PASSWORD_DEV
QUEUES_TOKEN: $QUEUES_TOKEN_DEV
deploy:
mode: replicated
restart_policy:
condition: any
update_config:
parallelism: 1
order: start-first
queues:
image: mathwave/sprint-repo:queues
networks:
- queues
- queues-development
environment:
MONGO_HOST: "mongo.develop.sprinthub.ru"
MONGO_PASSWORD: $MONGO_PASSWORD_DEV
NEW: "true"
deploy:
mode: replicated
restart_policy:
@ -35,7 +18,5 @@ services:
order: start-first
networks:
common-infra-nginx:
external: true
queues:
queues-development:
external: true

View File

@ -2,31 +2,13 @@ version: "3.4"
services:
queues-nginx:
image: mathwave/sprint-repo:queues
networks:
- common-infra-nginx
environment:
MONGO_HOST: "mongo.sprinthub.ru"
MONGO_PASSWORD: $MONGO_PASSWORD_PROD
QUEUES_TOKEN: $QUEUES_TOKEN_PROD
deploy:
mode: replicated
restart_policy:
condition: any
update_config:
parallelism: 1
order: start-first
queues:
image: mathwave/sprint-repo:queues
networks:
- common-infra-nginx
- queues
environment:
MONGO_HOST: "mongo.sprinthub.ru"
MONGO_PASSWORD: $MONGO_PASSWORD_PROD
NEW: "true"
deploy:
mode: replicated
restart_policy:
@ -36,7 +18,5 @@ services:
order: start-first
networks:
common-infra-nginx:
external: true
queues:
external: true

View File

@ -28,7 +28,7 @@ jobs:
run: docker push mathwave/sprint-repo:queues
deploy-dev:
name: Deploy dev
runs-on: [dev]
runs-on: [prod]
needs: push
steps:
- name: login
@ -40,5 +40,4 @@ jobs:
- name: deploy
env:
MONGO_PASSWORD_DEV: ${{ secrets.MONGO_PASSWORD_DEV }}
QUEUES_TOKEN_DEV: ${{ secrets.QUEUES_TOKEN_DEV }}
run: docker stack deploy --with-registry-auth -c ./.deploy/deploy-dev.yaml infra
run: docker stack deploy --with-registry-auth -c ./.deploy/deploy-dev.yaml infra-development

View File

@ -40,5 +40,4 @@ jobs:
- name: deploy
env:
MONGO_PASSWORD_PROD: ${{ secrets.MONGO_PASSWORD_PROD }}
QUEUES_TOKEN_PROD: ${{ secrets.QUEUES_TOKEN_PROD }}
run: docker stack deploy --with-registry-auth -c ./.deploy/deploy-prod.yaml infra

View File

@ -1,6 +1,5 @@
import fastapi
import uvicorn
import os
from app.routers import take
from app.routers import put
@ -19,6 +18,4 @@ mongo.create_indexes()
if __name__ == '__main__':
if os.getenv('NEW') == 'true':
uvicorn.run(app, host="0.0.0.0", port=1239)
uvicorn.run(app, host="0.0.0.0", port=1238)