10 months ago
My app requires a custom start command.
the "collectstatic" is needed in prod to copy the contents from static to staticfiles.
Essentially, it needs to run:
python manage.py collectstatic --clear --no-input
python manage.py runserver
gunicorn my_project.wsgi:applicationThe issue is that runserver and gunicorn are both commands that need to run in the foreground; and I've already tried several combinations of trying to modify the start command, running in the background, etc.
1. Custom start command (doesn't like ";" to run multiple commands)
python manage.py collectstatic --clear --no-input && python manage.py runserver && gunicorn mu_project.wsgi:application- Wrapping these in a shell script, e.g,.
/bin/sh -c "/app/run_prod.sh" - Running both the script and Gunicorn,
/bin/sh -c "/app/run_prod.sh" && gunicorn stealth_ai.wsgi:application
2 Replies
10 months ago
Hey there! We've found the following might help you get unblocked faster:
- 🧵 502 Bad Gateway after successful container start — Gunicorn running but Railway edge not routing
- 🧵 Custom start command error
- 🧵 Running celery with procfile or custom start command
If you find the answer from one of these, please let us know by solving the thread!
10 months ago
Does the gunicorn process not complete? What's the actual issue you're having? The command you shared should run them in succession.