From 56ced15c07f5c2f2d472e5fcc684df87a9146731 Mon Sep 17 00:00:00 2001 From: yukl-c <72858964+yukl-c@users.noreply.github.com> Date: Fri, 17 Oct 2025 16:10:49 +0800 Subject: [PATCH] Add Dockerfile for Python application setup --- server/Dockerfile | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 server/Dockerfile diff --git a/server/Dockerfile b/server/Dockerfile new file mode 100644 index 0000000000..5c5973974e --- /dev/null +++ b/server/Dockerfile @@ -0,0 +1,25 @@ + FROM python:3.12.0-slim-bookworm + + ENV PYTHONBUFFERED 1 + ENV PYTHONWRITEBYTECODE 1 + + ENV APP=/app + + # Change the workdir. + WORKDIR $APP + + # Install the requirements + COPY requirements.txt $APP + + RUN pip3 install -r requirements.txt + + # Copy the rest of the files + COPY . $APP + + EXPOSE 8000 + + RUN chmod +x /app/entrypoint.sh + + ENTRYPOINT ["/bin/bash","/app/entrypoint.sh"] + + CMD ["gunicorn", "--bind", ":8000", "--workers", "3", "djangoproj.wsgi"]