From ee5ed62881b0efc0cae0b376d0a198452d323ba5 Mon Sep 17 00:00:00 2001 From: eneller Date: Tue, 1 Jul 2025 23:55:16 +0200 Subject: [PATCH] build: Dockerfile --- Dockerfile | 19 +++++++++++++++++++ src/gunicorn.py | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..90d9921 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +FROM python:3.12 +VOLUME [ "/app/src/epub2go_web/media" ] +EXPOSE 50000/tcp +EXPOSE 50000/udp + +COPY --from=ghcr.io/astral-sh/uv:0.7.18 /uv /uvx /bin/ + +WORKDIR /app +# Install dependencies +RUN --mount=type=cache,target=/root/.cache/uv \ + --mount=type=bind,source=uv.lock,target=uv.lock \ + --mount=type=bind,source=pyproject.toml,target=pyproject.toml \ + uv sync --locked --no-install-project + +# Copy the project into the image +ADD . /app + +WORKDIR /app/src +CMD ["uv", "run", "gunicorn", "-c", "gunicorn.py"] \ No newline at end of file diff --git a/src/gunicorn.py b/src/gunicorn.py index b4c4dd1..7c14c6b 100644 --- a/src/gunicorn.py +++ b/src/gunicorn.py @@ -5,7 +5,7 @@ loglevel = "debug" # The number of worker processes for handling requests workers = 4 # The socket to bind -bind = "127.0.0.1:50000" +bind = "0.0.0.0:50000" # Restart workers when code changes (development only!) #reload = True # Write access and error info to /var/log