Added an unprivileged user, an healthcheck and unbuffered outputs

This commit is contained in:
Nicola Belluti
2025-01-30 11:22:03 +01:00
parent 0891dc0eda
commit e2ac4365d0

View File

@@ -1,12 +1,18 @@
FROM python:3.13-alpine FROM python:3.13-alpine
RUN adduser -D user
USER user
WORKDIR /opt/rdgen WORKDIR /opt/rdgen
COPY . . COPY . .
RUN pip install --no-cache-dir -r requirements.txt \ RUN pip install --no-cache-dir -r requirements.txt \
&& python manage.py migrate && python manage.py migrate
ENV PYTHONUNBUFFERED=1
EXPOSE 8000 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"]