diff --git a/compose/local/django/Dockerfile b/compose/local/django/Dockerfile index cf26bec..0cc1083 100644 --- a/compose/local/django/Dockerfile +++ b/compose/local/django/Dockerfile @@ -48,6 +48,14 @@ COPY ./compose/production/django/entrypoint /entrypoint RUN sed -i 's/\r$//g' /entrypoint RUN chmod +x /entrypoint +COPY ./compose/production/django/manage /manage +RUN sed -i 's/\r$//g' /manage +RUN chmod +x /manage + +COPY ./compose/production/django/manage /manage.py +RUN sed -i 's/\r$//g' /manage +RUN chmod +x /manage + COPY ./compose/local/django/start /start RUN sed -i 's/\r$//g' /start RUN chmod +x /start diff --git a/compose/production/django/manage b/compose/production/django/manage new file mode 100644 index 0000000..250dd1d --- /dev/null +++ b/compose/production/django/manage @@ -0,0 +1,14 @@ +#!/bin/bash + +set -o errexit +set -o pipefail +set -o nounset + +if [ -z "${POSTGRES_USER}" ]; then + base_postgres_image_default_user='postgres' + export POSTGRES_USER="${base_postgres_image_default_user}" +fi +export DATABASE_URL="postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}" + + +exec /venv/bin/python /app/manage.py "$@"