#51 chore(registry): imagen del backend para publicar en el registry de Gitea

- django.registry.Dockerfile: imagen autocontenida (codigo + entrypoint)
- docker/entrypoint.sh: migrate + collectstatic + gunicorn; con args ejecuta ese comando
- scripts/build-push-image.sh: build y push a gitea.onecluster.org/oneteam/don_confiao_backend (latest + git sha)
This commit is contained in:
2026-10-12 21:57:28 -05:00
parent 13e14e5d2e
commit 786359c102
3 changed files with 80 additions and 0 deletions

23
docker/entrypoint.sh Executable file
View File

@@ -0,0 +1,23 @@
#!/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 <imagen> 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