-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (20 loc) · 790 Bytes
/
Dockerfile
File metadata and controls
34 lines (20 loc) · 790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
LABEL version="1.0.2"
WORKDIR /code
# Enable bytecode compilation
ENV UV_COMPILE_BYTECODE=1
# Copy from the cache instead of linking since it's a mounted volume
ENV UV_LINK_MODE=copy
COPY pyproject.toml uv.lock ./
# Install the project's dependencies using the lockfile and settings
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 --no-dev
COPY . /code
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --no-dev
ENV PATH="/code/.venv/bin:$PATH"
COPY entrypoint.sh /code/entrypoint.sh
RUN chmod +x /code/entrypoint.sh
ENTRYPOINT ["/code/entrypoint.sh"]