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
[ -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
}
-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', '')