From f2593ca5b2bc7bbb1604a2358fe1f39325016cc5 Mon Sep 17 00:00:00 2001 From: Administrator Date: Fri, 12 Aug 2022 18:42:15 +0300 Subject: [PATCH] change replicas --- .deploy/deploy-dev.yaml | 43 +--------------------------- .deploy/deploy-prod.yaml | 62 +++++++--------------------------------- nginx/nginx.conf | 2 +- 3 files changed, 12 insertions(+), 95 deletions(-) diff --git a/.deploy/deploy-dev.yaml b/.deploy/deploy-dev.yaml index ede714e..204d594 100644 --- a/.deploy/deploy-dev.yaml +++ b/.deploy/deploy-dev.yaml @@ -88,26 +88,6 @@ services: restart_policy: condition: on-failure - collect_static: - image: mathwave/sprint-repo:sprint - networks: - - net - environment: - DB_HOST: "postgres" - FS_HOST: "storage" - RABBIT_HOST: "rabbitmq" - REDIS_HOST: "redis" - 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: global - restart_policy: - condition: on-failure - web: image: mathwave/sprint-repo:sprint networks: @@ -132,27 +112,6 @@ services: parallelism: 1 order: start-first - checker: - image: mathwave/sprint-repo:sprint - networks: - - net - environment: - DB_HOST: "postgres" - FS_HOST: "storage" - RABBIT_HOST: "rabbitmq" - REDIS_HOST: "redis" - DB_PASSWORD: $DB_PASSWORD - DEBUG: $DEBUG - TELEGRAM_TOKEN: $TELEGRAM_TOKEN - command: ./manage.py runserver 0.0.0.0:7999 --noreload - deploy: - mode: replicated - restart_policy: - condition: any - update_config: - parallelism: 1 - order: start-first - polling: image: mathwave/sprint-repo:sprint networks: @@ -259,7 +218,7 @@ services: - /var/run/docker.sock:/var/run/docker.sock deploy: mode: replicated - replicas: 4 + replicas: 2 restart_policy: condition: any update_config: diff --git a/.deploy/deploy-prod.yaml b/.deploy/deploy-prod.yaml index 96b392e..4314f42 100644 --- a/.deploy/deploy-prod.yaml +++ b/.deploy/deploy-prod.yaml @@ -113,10 +113,11 @@ services: restart_policy: condition: on-failure - collect_static: + apply-languages: image: mathwave/sprint-repo:sprint networks: - net + command: ./manage.py apply_languages environment: DB_HOST: "postgres" FS_HOST: "storage" @@ -125,11 +126,9 @@ services: 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: global + mode: replicated + replicas: 1 restart_policy: condition: on-failure @@ -151,29 +150,7 @@ services: command: ./manage.py runserver 0.0.0.0:8000 --noreload --insecure deploy: mode: replicated - replicas: 2 - restart_policy: - condition: any - update_config: - parallelism: 1 - order: start-first - - checker: - image: mathwave/sprint-repo:sprint - networks: - - net - environment: - DB_HOST: "postgres" - FS_HOST: "storage" - RABBIT_HOST: "rabbitmq" - REDIS_HOST: "redis" - DB_PASSWORD: $DB_PASSWORD - DEBUG: $DEBUG - TELEGRAM_TOKEN: $TELEGRAM_TOKEN - command: ./manage.py runserver 0.0.0.0:7999 --noreload - deploy: - mode: replicated - replicas: 2 + replicas: 1 restart_policy: condition: any update_config: @@ -195,7 +172,7 @@ services: command: ./manage.py runserver 0.0.0.0:7998 --noreload deploy: mode: replicated - replicas: 2 + replicas: 1 restart_policy: condition: any update_config: @@ -263,7 +240,7 @@ services: - /var/run/docker.sock:/var/run/docker.sock deploy: mode: replicated - replicas: 8 + replicas: 4 restart_policy: condition: any update_config: @@ -285,7 +262,7 @@ services: TELEGRAM_TOKEN: $TELEGRAM_TOKEN deploy: mode: replicated - replicas: 2 + replicas: 1 restart_policy: condition: any update_config: @@ -307,7 +284,7 @@ services: TELEGRAM_TOKEN: $TELEGRAM_TOKEN deploy: mode: replicated - replicas: 2 + replicas: 1 restart_policy: condition: any update_config: @@ -351,32 +328,13 @@ services: EMAIL_PASSWORD: $EMAIL_PASSWORD deploy: mode: replicated - replicas: 2 + replicas: 1 restart_policy: condition: any update_config: parallelism: 1 order: start-first - apply-languages: - image: mathwave/sprint-repo:sprint - networks: - - net - command: ./manage.py apply_languages - environment: - DB_HOST: "postgres" - FS_HOST: "storage" - RABBIT_HOST: "rabbitmq" - REDIS_HOST: "redis" - DB_PASSWORD: $DB_PASSWORD - DEBUG: $DEBUG - TELEGRAM_TOKEN: $TELEGRAM_TOKEN - deploy: - mode: replicated - replicas: 1 - restart_policy: - condition: on-failure - networks: net: driver: overlay diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 3e89ac9..9b6ef5d 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -14,7 +14,7 @@ http { } location /polling/ { - proxy_pass http://polling:7998/polling/; + proxy_pass http://polling:7999/polling/; } location / {