added nginx as a proxy. Still need to enable ssl.
This commit is contained in:
30
compose.yaml
30
compose.yaml
@@ -1,16 +1,21 @@
|
||||
services:
|
||||
web:
|
||||
build: .
|
||||
command: gunicorn --proxy-protocol auto --proxy-allow-from 10.10.50.11 website.wsgi:application
|
||||
command: gunicorn website.wsgi:application
|
||||
depends_on:
|
||||
- db
|
||||
ports:
|
||||
- 8000:8000
|
||||
environment:
|
||||
ALLOWED_HOSTS: ${NGINX_HOSTNAME}
|
||||
PYTHONDONTWRITEBYTECODE: 1
|
||||
PYTHONUNBUFFERED: 1
|
||||
DJANGO_SETTINGS_MODULE: ${DJANGO_SETTINGS_MODULE}
|
||||
VIRTUAL_HOST: localhost
|
||||
#VIRTUAL_PORT: 8000
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- static_volume:/app/static
|
||||
- media_volume:/app/media
|
||||
|
||||
|
||||
db:
|
||||
image: postgres:18
|
||||
@@ -30,6 +35,23 @@ services:
|
||||
ports:
|
||||
- 8080:8080
|
||||
|
||||
proxy:
|
||||
image: nginx:stable
|
||||
volumes:
|
||||
- ./.nginx/.templates:/etc/nginx/templates
|
||||
- static_volume:/app/static:ro
|
||||
- media_volume:/app/media:ro
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- 80:80
|
||||
- 443:443
|
||||
environment:
|
||||
- NGINX_HOSTNAME=${NGINX_HOSTNAME}
|
||||
- NGINX_PORT=80
|
||||
- NGINX_SSL_PORT=443
|
||||
depends_on:
|
||||
- web
|
||||
|
||||
test:
|
||||
build: .
|
||||
command: python manage.py test
|
||||
@@ -41,3 +63,5 @@ services:
|
||||
|
||||
volumes:
|
||||
postgres_data:
|
||||
static_volume:
|
||||
media_volume:
|
||||
|
||||
Reference in New Issue
Block a user