diff options
| author | 2025-11-09 20:35:29 +0000 | |
|---|---|---|
| committer | 2025-11-09 20:35:51 +0000 | |
| commit | a4f5f31fb5b21d390ae39e395ee78eb1aa82de78 (patch) | |
| tree | e017568430c0ca05f33338b36ffc5a1981751086 | |
| parent | Change Docker dev mounted volume to just dev folder (diff) | |
Convert dev Dockerfile to using uv
| -rw-r--r-- | dev/Dockerfile | 23 |
1 files 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"] |