-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (22 loc) · 927 Bytes
/
Dockerfile
File metadata and controls
31 lines (22 loc) · 927 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
FROM python:3.12-slim-bullseye
COPY --from=ghcr.io/astral-sh/uv:0.4.30 /uv /bin/uv
FROM python:3.12-slim-bullseye
# The installer requires curl (and certificates) to download the release archive
RUN apt-get update && apt-get install -y --no-install-recommends curl ca-certificates
# Download the latest installer
ADD https://astral.sh/uv/0.4.30/install.sh /uv-installer.sh
# Run the installer then remove it
RUN sh /uv-installer.sh && rm /uv-installer.sh
# Ensure the installed binary is on the `PATH`
ENV PATH="/root/.cargo/bin/:$PATH"
# Copy the project into the image
ADD . /app
WORKDIR /app
# Sync the project into a new environment
RUN uv sync
# Use the virtual environment automatically
ENV VIRTUAL_ENV=/app/.venv
# Place executables in the environment at the front of the path
ENV PATH="/app/.venv/bin:$PATH"
# Presuming there is a `my_app` command provided by the project
CMD ["uv", "run", "src/api/server.py"]