diff --git a/Dockerfile b/Dockerfile index 252091a..f3ce0a7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,4 +14,7 @@ RUN python manage.py collectstatic ENV DJANGO_DEBUG_FALSE=1 +RUN adduser --uid 1234 nonroot +# USER nonroot + CMD ["gunicorn", "--bind", ":8888", "core.wsgi:application"] \ No newline at end of file diff --git a/container.db.sqlite3 b/container.db.sqlite3 new file mode 100644 index 0000000..e69de29 diff --git a/src/core/settings.py b/src/core/settings.py index 127960d..7332355 100644 --- a/src/core/settings.py +++ b/src/core/settings.py @@ -25,12 +25,14 @@ BASE_DIR = Path(__file__).resolve().parent.parent if 'DJANGO_DEBUG_FALSE' in os.environ: DEBUG = False SECRET_KEY = os.environ['DJANGO_SECRET_KEY'] - ALLOWED_HOSTS = [os.environ["DJANGO_ALLOWED_HOST"]] + ALLOWED_HOSTS = [os.environ['DJANGO_ALLOWED_HOST']] + db_path = os.environ['DJANGO_DB_PATH'] else: DEBUG = True # SECURITY WARNING: keep the secret key used in production secret! SECRET_KEY = 'django-insecure-&9b_h=qpjy=sshhnsyg98&jp7(t6*v78__y%h2l$b#_@6z$-9r' ALLOWED_HOSTS = [] + db_path = BASE_DIR / 'db.sqlite3' # Application definition @@ -85,7 +87,7 @@ ASGI_APPLICATION = 'core.asgi.application' DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': BASE_DIR / 'db.sqlite3', + 'NAME': db_path, } }