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

@@ -19,6 +19,11 @@ services:
env_file: .env.production
ports:
- "127.0.0.1:${WEB_PORT:-8001}:8000"
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
@@ -53,3 +58,4 @@ services:
volumes:
pgdata:
media_data: