reworded docker compose files to segregate responsibilites. Dev version no longer uses the nginx proxy to proxy, merely to be the static file server. Also dev version no longer used gunicorn as it was screwing up the live reload functionality and didn't provide any other benefit.

This commit is contained in:
Wouter Vermeer
2026-04-30 17:41:21 +02:00
parent a0a0cfab8a
commit 358bd4cbf2
4 changed files with 52 additions and 31 deletions

View File

@@ -2,16 +2,9 @@
services:
web:
build: .
command: gunicorn website.wsgi:application
depends_on:
db:
condition: service_healthy
environment:
ALLOWED_HOSTS: ${NGINX_HOSTNAME}
DJANGO_SETTINGS_MODULE: ${DJANGO_SETTINGS_MODULE}
# VIRTUAL_HOST: localhost
# VIRTUAL_PORT: 8000
restart: unless-stopped
volumes: [static_volume:/app/static, media_volume:/app/media]
networks: [frontend, backend]
db:
@@ -21,32 +14,24 @@ services:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes: [postgres_data:/var/lib/postgresql]
restart: unless-stopped
healthcheck:
test: [CMD-SHELL, 'pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DBNAME}']
interval: 5s
retries: 5
networks: [backend]
adminer:
image: adminer
depends_on: [db]
restart: always
ports: [127.0.0.1:8080:8080]
networks: [backend]
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]
networks: [frontend]
adminer:
image: adminer
depends_on: [db]
ports: [127.0.0.1:8080:8080]
networks: [backend]
networks:
frontend:
backend: