From 3adeb7c5a777fcbbc49c17b1fcc2ac75fb8e6771 Mon Sep 17 00:00:00 2001 From: Alexander-D-Karpov Date: Thu, 28 Dec 2023 02:28:47 +0300 Subject: [PATCH] added manage command --- compose/local/django/Dockerfile | 8 ++++++++ compose/production/django/manage | 14 ++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 compose/production/django/manage 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 "$@"