#!/bin/sh # Entrypoint de la imagen de produccion del backend. # # Sin argumentos: aplica migraciones, colecta estaticos y arranca gunicorn. # Con argumentos: ejecuta ese comando tal cual (util para operaciones, p. ej. # docker run --rm python manage.py createsuperuser). set -e if [ "$#" -gt 0 ]; then exec "$@" fi echo "[entrypoint] Aplicando migraciones..." python manage.py migrate --noinput echo "[entrypoint] Colectando estaticos..." python manage.py collectstatic --noinput echo "[entrypoint] Arrancando gunicorn en 0.0.0.0:8000..." exec gunicorn config.wsgi:application \ --bind 0.0.0.0:8000 \ --workers "${GUNICORN_WORKERS:-4}" \ --timeout 120