-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
38 lines (29 loc) · 1.36 KB
/
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
28
29
30
31
32
33
34
35
36
37
38
# Install uv
FROM python:3.13-slim AS builder
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
# Change the working directory to the `app` directory
WORKDIR /app
# Install dependencies
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-install-project --no-editable
# Copy the project into the intermediate image
COPY . /app
# Sync the project
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-editable
# ------
FROM python:3.13-slim
LABEL org.opencontainers.image.title=Hutch\ Bunny
LABEL org.opencontainers.image.description=Hutch\ Bunny
LABEL org.opencontainers.image.vendor=University\ of\ Nottingham
LABEL org.opencontainers.image.url=https://github.com/Health-Informatics-UoN/hutch-bunny/pkgs/container/hutch%2Fbunny
LABEL org.opencontainers.image.documentation=https://health-informatics-uon.github.io/hutch/bunny
LABEL org.opencontainers.image.source=https://github.com/Health-Informatics-UoN/hutch-bunny
LABEL org.opencontainers.image.licenses=MIT
# Copy the environment, but not the source code
COPY --from=builder --chown=app:app /app/.venv /app/.venv
ENV PATH="/app/.venv/bin:$PATH"
# Run Bunny Daemon by default; user can override and run the CLI by specifying `bunny`
CMD ["bunny-daemon"]