Added an unprivileged user, an healthcheck and unbuffered outputs
This commit is contained in:
10
Dockerfile
10
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"]
|
||||
|
Reference in New Issue
Block a user