From bc16c3fad3ca3ff0691720545b70ab1fcce9eea4 Mon Sep 17 00:00:00 2001 From: Egor Matveev Date: Tue, 29 Mar 2022 14:59:27 +0300 Subject: [PATCH] nginx --- docker-compose-deploy.yaml | 18 ++++++++++++++++-- nginx/nginx.conf | 7 +++++++ 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 nginx/nginx.conf diff --git a/docker-compose-deploy.yaml b/docker-compose-deploy.yaml index 70a8007..0a77cbd 100644 --- a/docker-compose-deploy.yaml +++ b/docker-compose-deploy.yaml @@ -3,6 +3,22 @@ version: "3.4" services: + nginx: + image: nginx + volumes: + - nginx:/etc/nginx + networks: + - net + ports: + - "80:80" + deploy: + mode: replicated + restart_policy: + condition: any + update_config: + parallelism: 1 + order: start-first + postgres: image: postgres environment: @@ -81,8 +97,6 @@ services: volumes: - /sprint-data/static:/usr/src/app/static command: ./manage.py runserver 0.0.0.0:80 --noreload --insecure - ports: - - "80:80" deploy: mode: replicated restart_policy: diff --git a/nginx/nginx.conf b/nginx/nginx.conf new file mode 100644 index 0000000..b7d1df7 --- /dev/null +++ b/nginx/nginx.conf @@ -0,0 +1,7 @@ +server { + listen 80; + + location / { + proxy_pass http://web:8000/; + } +} \ No newline at end of file