Skip to content

Commit 53499e5

Browse files
committed
Use uv in Dockerfile
1 parent 9041dfb commit 53499e5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ FROM python:3.11
33
RUN apt-get update && \
44
apt-get clean && \
55
rm -rf /var/lib/apt/lists/*
6-
6+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
77
ENV PYTHONUNBUFFERED=1
88
WORKDIR /opt/hackergame
9-
COPY requirements.txt /opt/hackergame/
10-
RUN pip3 install --upgrade -r requirements.txt
9+
RUN --mount=type=cache,target=/root/.cache/uv \
10+
--mount=type=bind,source=uv.lock,target=uv.lock \
11+
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
12+
uv sync --locked --no-install-project
1113
# Bind project inside instead of copying it
1214
# to avoid copying credentials inside container
1315
# COPY ./ /opt/hackergame/

0 commit comments

Comments
 (0)