From 644b3c0bc8dc3da4b5492f4fbd1646219108c8c5 Mon Sep 17 00:00:00 2001 From: Administrator Date: Sun, 21 Aug 2022 12:18:00 +0300 Subject: [PATCH] command --- .deploy/deploy-dev.yaml | 30 +----------------------------- .deploy/deploy-prod.yaml | 4 +--- nginx/nginx.conf | 5 ----- 3 files changed, 2 insertions(+), 37 deletions(-) diff --git a/.deploy/deploy-dev.yaml b/.deploy/deploy-dev.yaml index 1ea5144..df79c13 100644 --- a/.deploy/deploy-dev.yaml +++ b/.deploy/deploy-dev.yaml @@ -41,30 +41,6 @@ services: restart_policy: condition: on-failure - collect_static: - image: mathwave/sprint-repo:sprint - command: ./manage.py collectstatic --noinput - networks: - - net - environment: - DB_HOST: "pg.develop.sprinthub.ru" - FS_HOST: "storage" - RABBIT_HOST: "rabbitmq.develop.sprinthub.ru" - REDIS_HOST: "redis.develop.sprinthub.ru" - RABBIT_PASSWORD: $RABBITMQ_PASSWORD_DEV - REDIS_PASSWORD: $REDIS_PASSWORD_DEV - DB_PASSWORD: $DB_PASSWORD_DEV - DEBUG: "true" - TELEGRAM_TOKEN: $TELEGRAM_TOKEN_DEV - volumes: - - /sprint-data/static:/usr/src/app/static - deploy: - mode: replicated - placement: - constraints: [node.role == manager] - restart_policy: - condition: on-failure - web: image: mathwave/sprint-repo:sprint networks: @@ -80,13 +56,9 @@ services: DEBUG: "true" TELEGRAM_TOKEN: $TELEGRAM_TOKEN VK_SERVICE_TOKEN: $VK_SERVICE_TOKEN - volumes: - - /sprint-data/static:/usr/src/app/static - command: ./manage.py runserver 0.0.0.0:8000 --noreload --insecure + command: sh -c "./manage.py collectstatic --noinput && ./manage.py runserver 0.0.0.0:8000 --noreload --insecure" deploy: mode: replicated - placement: - constraints: [node.role == manager] restart_policy: condition: any update_config: diff --git a/.deploy/deploy-prod.yaml b/.deploy/deploy-prod.yaml index 49a46fd..58c842a 100644 --- a/.deploy/deploy-prod.yaml +++ b/.deploy/deploy-prod.yaml @@ -107,9 +107,7 @@ services: DEBUG: "false" TELEGRAM_TOKEN: $TELEGRAM_TOKEN VK_SERVICE_TOKEN: $VK_SERVICE_TOKEN - volumes: - - /sprint-data/static:/usr/src/app/static - command: ./manage.py runserver 0.0.0.0:8000 --noreload --insecure + command: sh -c "./manage.py collectstatic --noinput && ./manage.py runserver 0.0.0.0:8000 --noreload --insecure" deploy: mode: replicated placement: diff --git a/nginx/nginx.conf b/nginx/nginx.conf index 32ab2a9..497551e 100644 --- a/nginx/nginx.conf +++ b/nginx/nginx.conf @@ -12,11 +12,6 @@ http { proxy_pass http://polling:7998/polling/; } - location /static/ { - root /var/www/html/; - autoindex off; - } - location / { proxy_pass http://web:8000/; }