#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:
23
docker/entrypoint.sh
Executable file
23
docker/entrypoint.sh
Executable 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
|
||||
Reference in New Issue
Block a user