-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
27 lines (21 loc) · 834 Bytes
/
Dockerfile
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
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim
WORKDIR /app
# Enable optimisations for all `uv` commands
ENV UV_COMPILE_BYTECODE=1
ENV UV_LINK_MODE=copy
# Add binaries from venv to path
ENV PATH="/app/.venv/bin:$PATH"
# Install dependencies without installing project
# Since dependencies change less often than project code, this saves rebuild time
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 --frozen --no-dev --no-install-project
# Install project itself
ADD . /app
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev
# Reset the entrypoint, don't invoke `uv`
ENTRYPOINT []
# Let's run this thing
CMD ["waitress-serve", "--call", "blobdash:create_app"]