From a4f5f31fb5b21d390ae39e395ee78eb1aa82de78 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Sun, 9 Nov 2025 20:35:29 +0000 Subject: Convert dev Dockerfile to using uv --- dev/Dockerfile | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/dev/Dockerfile b/dev/Dockerfile index bb85d679..d75ff378 100644 --- a/dev/Dockerfile +++ b/dev/Dockerfile @@ -1,17 +1,26 @@ -ARG python_version=3.11 +ARG python_version=3.14-slim -FROM --platform=linux/amd64 ghcr.io/owl-corp/python-poetry-base:$python_version-slim +FROM python:$python_version AS builder +COPY --from=ghcr.io/astral-sh/uv:0.9 /uv /bin/ + +ENV UV_COMPILE_BYTECODE=1 \ + UV_LINK_MODE=copy # Install project dependencies WORKDIR /app -COPY pyproject.toml poetry.lock ./ -RUN poetry install --no-root --only dev,main +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 --no-install-project --frozen --group dev # Copy the source code in last to optimize rebuilding the image COPY . . # Install again, this time with the root project -RUN poetry install --only-root +RUN uv pip install "pydis_core[all]@." + +WORKDIR /app/dev +ENV PATH="/app/.venv/bin:$PATH" -ENTRYPOINT ["poetry"] -CMD ["run", "python", "-m", "bot"] +ENTRYPOINT ["python"] +CMD ["-m", "bot"] -- cgit v1.2.3