added nginx for prod

pull/2/head
mtyton 2023-05-26 00:47:35 +02:00
rodzic 819f452a8b
commit c927b700e4
2 zmienionych plików z 45 dodań i 16 usunięć

Wyświetl plik

@ -1,21 +1,6 @@
version: "3.8"
services:
comfy:
build:
dockerfile: Dockerfile
context: ./
restart: always
ports:
- "8000:8000"
volumes:
- ./:/app
environment:
- SECRET_KEY
- DATABASE_URL
- DJANGO_SETTINGS_MODULE
env_file:
- .env
db:
image: postgres
restart: always
@ -28,3 +13,31 @@ services:
- ../postgres/:/var/lib/postgresql
env_file:
- .env
comfy:
build:
dockerfile: Dockerfile
context: ./
restart: always
ports:
- "8001:8000"
volumes:
- ./:/app
environment:
- SECRET_KEY
- DATABASE_URL
- DJANGO_SETTINGS_MODULE
env_file:
- .env
depends_on:
- db
web:
image: nginx
volumes:
- ../nginx/nginx.conf:/etc/nginx/nginx.conf
ports:
- "8000:80"
environment:
- NGINX_HOST=artel.tepewu.pl
- NGINX_PORT=80

16
nginx/nginx.conf 100644
Wyświetl plik

@ -0,0 +1,16 @@
upstream comfy {
server comfy:8001;
}
server {
listen 80;
location / {
proxy_pass http://comfy;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
}
}