diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..8400d08 --- /dev/null +++ b/Makefile @@ -0,0 +1,3 @@ +dev: + docker compose down + docker compose up --build diff --git a/compose.yaml b/compose.yaml index cde2bbf..7365725 100644 --- a/compose.yaml +++ b/compose.yaml @@ -1,6 +1,7 @@ services: web: build: . + command: gunicorn --proxy-protocol auto --proxy-allow-from 10.10.50.11 website.wsgi:application depends_on: - db ports: @@ -9,8 +10,7 @@ services: PYTHONDONTWRITEBYTECODE: 1 PYTHONUNBUFFERED: 1 DJANGO_SETTINGS_MODULE: ${DJANGO_SETTINGS_MODULE} - env_file: - .env + env_file: ".env" restart: unless-stopped db: @@ -21,6 +21,7 @@ services: POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} volumes: - postgres_data:/var/lib/postgresql + env_file: ".env" restart: unless-stopped adminer: diff --git a/src/website/settings.py b/src/website/settings.py index f7bd626..96543e2 100644 --- a/src/website/settings.py +++ b/src/website/settings.py @@ -24,10 +24,11 @@ BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = "django-insecure-c$q7wdq+u@ow74wp!&zzkxdylkueu)(+34e%!e0du&bjwoqz9z" # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = os.getenv("DEBUG") +DEBUG = bool(os.getenv("DEBUG")) -ALLOWED_HOSTS = os.getenv("ALLOWED_HOSTS") +ALLOWED_HOSTS = os.getenv("ALLOWED_HOSTS").split(",") +SECURE_PROXY_SSL_HEADER = ("HTTP_X_FORWARDED_PROTO", "https") # Application definition