Fix club logo 404 in production and persist uploads

/media/* was only routed when DEBUG=True, so uploaded club logos
404d in production regardless of storage backend. Route it whenever
local-disk storage is in use instead, and give web a persistent
volume for MEDIA_ROOT so uploads survive a rebuild.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-06 20:41:33 +02:00
parent 30b464eb56
commit 5b8ab72982
4 changed files with 25 additions and 4 deletions

View File

@@ -32,6 +32,11 @@ services:
build: .
restart: unless-stopped
env_file: .env.production
volumes:
# Uploaded club logos, while storage is local disk (see rosterchief/urls.py). Without
# this, a rebuild or recreate wipes MEDIA_ROOT even though the container itself keeps
# running fine in between.
- media_data:/app/media
depends_on:
db:
condition: service_healthy
@@ -70,3 +75,4 @@ volumes:
pgdata:
caddy_data:
caddy_config:
media_data: