From c08bdc3384cf210b5c28ae087043da4b3e498d44 Mon Sep 17 00:00:00 2001 From: Markus Rosenstihl Date: Tue, 14 Apr 2026 13:46:51 +0200 Subject: [PATCH] moved settings from devel to production --- Dockerfile | 10 ++++------ README.md | 11 +++++++++++ excel_mimic/settings.py | 4 ++-- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9e4a87f..e30cdec 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,9 +2,8 @@ FROM python:3.13-alpine COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ +RUN apk add --no-cache sqlite -# Create the app directory -#RUN mkdir /app # Set the working directory inside the container WORKDIR /app @@ -20,10 +19,6 @@ RUN adduser \ # Set environment variables -## Django -# Allow all hosts -ENV DJANGO_ALLOWED_HOSTS=* - ## Python # Prevents Python from writing pyc files to disk ENV PYTHONDONTWRITEBYTECODE=1 @@ -61,5 +56,8 @@ EXPOSE 8000 # Switch to the non-privileged user to run the application. USER appuser +# Allow all hosts +ENV DJANGO_ALLOWED_HOSTS=* + # Run Django’s development server CMD ["uv", "run", "manage.py", "runserver", "0.0.0.0:8000"] diff --git a/README.md b/README.md index b85a860..d6db214 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,14 @@ +# Build new container + podman build . -t he-database + podman tag he-database gitea.pkm.physik.tu-darmstadt.de/markusro/he-database:latest + podman push gitea.pkm.physik.tu-darmstadt.de/markusro/he-database:latest + +# Run and update container +Also check documentation from [RedHat](https://docs.redhat.com/en/documentation/red_hat_enterprise_linux_atomic_host/7/html/managing_containers/running_containers_as_systemd_services_with_podman). + + podman pull gitea.pkm.physik.tu-darmstadt.de/markusro/he-database:latest + podman run --replace --detach --name he-database -p 8000:8000 he-database:latest + # Create DB Schema in chartdb.io 1. go to https://app.chartdb.io diff --git a/excel_mimic/settings.py b/excel_mimic/settings.py index 2f207b7..be71cb3 100644 --- a/excel_mimic/settings.py +++ b/excel_mimic/settings.py @@ -23,9 +23,9 @@ BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = 'django-insecure-qsqw7#kmvlyc1ou5emdh8^_bqnvp+hui(4w#1yy4ui82+p=%p*' # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +DEBUG = False -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ["*"] # Application definition