Skip to content

Commit a4f5f31

Browse files
committed
Convert dev Dockerfile to using uv
1 parent 4ae521e commit a4f5f31

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

dev/Dockerfile

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
1-
ARG python_version=3.11
1+
ARG python_version=3.14-slim
22

3-
FROM --platform=linux/amd64 ghcr.io/owl-corp/python-poetry-base:$python_version-slim
3+
FROM python:$python_version AS builder
4+
COPY --from=ghcr.io/astral-sh/uv:0.9 /uv /bin/
5+
6+
ENV UV_COMPILE_BYTECODE=1 \
7+
UV_LINK_MODE=copy
48

59
# Install project dependencies
610
WORKDIR /app
7-
COPY pyproject.toml poetry.lock ./
8-
RUN poetry install --no-root --only dev,main
11+
RUN --mount=type=cache,target=/root/.cache/uv \
12+
--mount=type=bind,source=uv.lock,target=uv.lock \
13+
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
14+
uv sync --no-install-project --frozen --group dev
915

1016
# Copy the source code in last to optimize rebuilding the image
1117
COPY . .
1218

1319
# Install again, this time with the root project
14-
RUN poetry install --only-root
20+
RUN uv pip install "pydis_core[all]@."
21+
22+
WORKDIR /app/dev
23+
ENV PATH="/app/.venv/bin:$PATH"
1524

16-
ENTRYPOINT ["poetry"]
17-
CMD ["run", "python", "-m", "bot"]
25+
ENTRYPOINT ["python"]
26+
CMD ["-m", "bot"]

0 commit comments

Comments
 (0)