Start adding deployment infra.
This commit is contained in:
parent
288759146c
commit
9576202fa1
11 changed files with 121 additions and 12 deletions
16
wedding_site/Dockerfile
Normal file
16
wedding_site/Dockerfile
Normal file
|
@ -0,0 +1,16 @@
|
|||
# pull official base image
|
||||
FROM python:3.11.4-slim-buster
|
||||
|
||||
# set environment variables
|
||||
ENV PYTHONDONTWRITEBYTECODE 1
|
||||
ENV PYTHONUNBUFFERED 1
|
||||
|
||||
# install dependencies
|
||||
RUN pip install --upgrade pip
|
||||
COPY ./requirements.txt .
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
RUN mkdir staticfiles
|
||||
|
||||
# copy project
|
||||
COPY . .
|
5
wedding_site/requirements.txt
Normal file
5
wedding_site/requirements.txt
Normal file
|
@ -0,0 +1,5 @@
|
|||
django
|
||||
markdown
|
||||
pillow
|
||||
beautifulsoup4
|
||||
gunicorn
|
|
@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/5.0/ref/settings/
|
|||
"""
|
||||
|
||||
from pathlib import Path
|
||||
import os
|
||||
|
||||
# Build paths inside the project like this: BASE_DIR / 'subdir'.
|
||||
BASE_DIR = Path(__file__).resolve().parent.parent
|
||||
|
@ -19,13 +20,11 @@ BASE_DIR = Path(__file__).resolve().parent.parent
|
|||
# Quick-start development settings - unsuitable for production
|
||||
# See https://docs.djangoproject.com/en/5.0/howto/deployment/checklist/
|
||||
|
||||
# SECURITY WARNING: keep the secret key used in production secret!
|
||||
SECRET_KEY = 'django-insecure-bj9fez3qztt5e2lrzpgh%%nat@w^kn!k@l92l=+#%wm)4)p^5m'
|
||||
SECRET_KEY = os.environ.get("SECRET_KEY")
|
||||
|
||||
# SECURITY WARNING: don't run with debug turned on in production!
|
||||
DEBUG = True
|
||||
DEBUG = bool(os.environ.get("DEBUG", default=0))
|
||||
|
||||
ALLOWED_HOSTS = ["localhost"]
|
||||
ALLOWED_HOSTS = os.environ.get("DJANGO_ALLOWED_HOSTS").split(" ")
|
||||
|
||||
|
||||
# Application definition
|
||||
|
@ -117,6 +116,7 @@ USE_TZ = True
|
|||
# https://docs.djangoproject.com/en/5.0/howto/static-files/
|
||||
|
||||
STATIC_URL = 'static/'
|
||||
STATIC_ROOT = BASE_DIR / "staticfiles"
|
||||
|
||||
# Default primary key field type
|
||||
# https://docs.djangoproject.com/en/5.0/ref/settings/#default-auto-field
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue