Commit 3cbd9b1
fix(start): allow skipping collectstatic via DISABLE_COLLECTSTATIC env var
Deployments that serve static files from an external CDN (e.g. Netlify) do
not need Django's `collectstatic` to run on container boot. When the
configured `STATICFILES_STORAGE` backend is unreachable, `collectstatic`
can hang indefinitely on a network call, blocking gunicorn from starting
and causing 502 Bad Gateway responses upstream until the container is
killed and recreated.
This adds an opt-in env var (`DISABLE_COLLECTSTATIC=1`) that skips the
step entirely in `compose/production/django/start`. Default behaviour
(running `collectstatic`) is unchanged.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 0a87a3a commit 3cbd9b1
1 file changed
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
8 | 12 | | |
9 | 13 | | |
10 | 14 | | |
| |||
0 commit comments