-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (20 loc) · 829 Bytes
/
Dockerfile
File metadata and controls
29 lines (20 loc) · 829 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
# Use an official Python runtime as a parent image
FROM python:3.12-slim-bookworm
# 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/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/.local/bin/:$PATH"
# Set the working directory
WORKDIR /code/app
# Copy the pyproject.toml and uv.lock files
COPY pyproject.toml uv.lock /code/
# Install dependencies using uv
RUN uv sync --frozen
# Copy the application code
COPY ./app /code/app
# Command to run the application
CMD ["uv", "run", "fastapi", "run", "main.py", "--port", "80"]