added manage command

This commit is contained in:
Alexander Karpov 2023-12-28 02:28:47 +03:00
parent af5f1f8afc
commit 3adeb7c5a7
2 changed files with 22 additions and 0 deletions

View File

@ -48,6 +48,14 @@ COPY ./compose/production/django/entrypoint /entrypoint
RUN sed -i 's/\r$//g' /entrypoint RUN sed -i 's/\r$//g' /entrypoint
RUN chmod +x /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 COPY ./compose/local/django/start /start
RUN sed -i 's/\r$//g' /start RUN sed -i 's/\r$//g' /start
RUN chmod +x /start RUN chmod +x /start

View File

@ -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 "$@"