From: Radek Czajka Date: Mon, 24 Jun 2024 18:33:32 +0000 (+0200) Subject: deployment stuff X-Git-Url: https://git.mdrn.pl/cas.git/commitdiff_plain/76fc5b2671d4c445e57236a5b1d54e56fe49764a?ds=sidebyside deployment stuff --- diff --git a/Dockerfile b/Dockerfile index 2b7586c..70bd4f0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,13 +3,11 @@ FROM python:3.10-alpine AS base COPY requirements.txt requirements.txt RUN pip install --no-cache-dir -r requirements.txt -WORKDIR /app +WORKDIR /app/src FROM base AS prod -COPY src src - RUN pip install --no-cache-dir gunicorn psycopg2-binary -RUN src/manage.py collectstatic --no-input +COPY src /app/src diff --git a/manage b/manage index 62e0c46..c27ba11 100755 --- a/manage +++ b/manage @@ -6,7 +6,7 @@ then [ -z "$PORT" ] && PORT=8000 EXPOSED=127.0.0.1:"$PORT" echo "expose as: $EXPOSED" - exec docker-compose run -p "$EXPOSED":"$PORT" dev python src/manage.py runserver 0.0.0.0:"$PORT" + exec docker-compose run -p "$EXPOSED":"$PORT" dev python $PYARGS manage.py runserver 0.0.0.0:"$PORT" else - exec docker-compose run dev python src/manage.py "$@" + exec docker-compose run dev python $PYARGS manage.py "$@" fi diff --git a/src/cas/settings.py b/src/cas/settings.py index 36e8ba3..5668804 100644 --- a/src/cas/settings.py +++ b/src/cas/settings.py @@ -40,9 +40,9 @@ else: } -DEBUG = os.environ.get('DEBUG', str(DEBUG)).lower() == 'True' - +DEBUG = os.environ.get('DEBUG', str(DEBUG)).lower() == 'true' +EMAIL_HOST = os.environ.get('EMAIL_HOST', 'localhost') DEFAULT_FROM_EMAIL = os.environ.get('DEFAULT_FROM_EMAIL', '') EMAIL_SUBJECT_PREFIX = os.environ.get('EMAIL_SUBJECT_PREFIX', '') SECRET_KEY = os.environ.get('SECRET_KEY', '')