fix: use entrypoint script for prod container startup
YAML folded block scalar (>) was preserving newlines for more-indented continuation lines, so gunicorn received no arguments and defaulted to binding on 127.0.0.1:8000. Replace with an explicit entrypoint script so all args are passed correctly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
14
deploy/entrypoint.prod.sh
Executable file
14
deploy/entrypoint.prod.sh
Executable file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
python manage.py tailwind install --no-input
|
||||||
|
python manage.py tailwind build
|
||||||
|
python manage.py migrate --noinput
|
||||||
|
python manage.py collectstatic --noinput
|
||||||
|
|
||||||
|
exec gunicorn config.wsgi:application \
|
||||||
|
--workers 3 \
|
||||||
|
--bind 0.0.0.0:8000 \
|
||||||
|
--access-logfile - \
|
||||||
|
--error-logfile - \
|
||||||
|
--capture-output
|
||||||
@@ -2,17 +2,7 @@ services:
|
|||||||
web:
|
web:
|
||||||
build: app
|
build: app
|
||||||
working_dir: /app
|
working_dir: /app
|
||||||
command: >
|
command: /app/deploy/entrypoint.prod.sh
|
||||||
sh -c "python manage.py tailwind install --no-input &&
|
|
||||||
python manage.py tailwind build &&
|
|
||||||
python manage.py migrate --noinput &&
|
|
||||||
python manage.py collectstatic --noinput &&
|
|
||||||
gunicorn config.wsgi:application
|
|
||||||
--workers 3
|
|
||||||
--bind 0.0.0.0:8000
|
|
||||||
--access-logfile -
|
|
||||||
--error-logfile -
|
|
||||||
--capture-output"
|
|
||||||
env_file: .env
|
env_file: .env
|
||||||
environment:
|
environment:
|
||||||
DJANGO_SETTINGS_MODULE: config.settings.production
|
DJANGO_SETTINGS_MODULE: config.settings.production
|
||||||
|
|||||||
Reference in New Issue
Block a user