From e2ac4365d0d8dd82843ed793220d3c8bebf7d732 Mon Sep 17 00:00:00 2001 From: Nicola Belluti Date: Thu, 30 Jan 2025 11:22:03 +0100 Subject: [PATCH] Added an unprivileged user, an healthcheck and unbuffered outputs --- Dockerfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 370ca5d..5de7316 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,18 @@ FROM python:3.13-alpine +RUN adduser -D user +USER user + WORKDIR /opt/rdgen COPY . . - RUN pip install --no-cache-dir -r requirements.txt \ && python manage.py migrate +ENV PYTHONUNBUFFERED=1 + EXPOSE 8000 -CMD ["gunicorn", "-c", "gunicorn.conf.py", "rdgen.wsgi:application"] +HEALTHCHECK --interval=30s --timeout=5s --retries=3 CMD wget --spider 0.0.0.0:8000 + +CMD ["/home/user/.local/bin/gunicorn", "-c", "gunicorn.conf.py", "rdgen.wsgi:application"]