From 03e41cf6854ebe02dda05c5ea7223a672edf985e Mon Sep 17 00:00:00 2001 From: Remy Moll Date: Tue, 13 May 2025 16:52:20 +0200 Subject: [PATCH] switch to multistage build --- .dockerignore | 8 -------- Dockerfile | 13 +++++++++---- 2 files changed, 9 insertions(+), 12 deletions(-) delete mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index db7e340..0000000 --- a/.dockerignore +++ /dev/null @@ -1,8 +0,0 @@ -.env -__pycache__ -.venv -.pytest_cache -docs -node_modules -output -sketching diff --git a/Dockerfile b/Dockerfile index 161a820..054c4f0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,15 @@ -FROM ghcr.io/astral-sh/uv:0.6-python3.12-bookworm +# use python 3.12 as a base image +FROM docker.io/python:3.12-alpine +# use the latest version of uv, independently of the python version +COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ WORKDIR /app -COPY pyproject.toml uv.lock ./ +# copy the requirements and install them +COPY pyproject.toml uv.lock . RUN uv sync --frozen -COPY . . +# copy the rest of the code +COPY src . -CMD ["uv", "run", "main.py"] \ No newline at end of file +CMD ["uv", "run", "main.py"]