-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (19 loc) · 765 Bytes
/
Dockerfile
File metadata and controls
33 lines (19 loc) · 765 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
ARG PYTHON_VERSION=3.12.4
FROM python:${PYTHON_VERSION}-slim AS build
RUN apt-get update && apt-get install -y ca-certificates
FROM python:${PYTHON_VERSION}-slim
WORKDIR /src
RUN apt-get update && \
apt-get install -y --no-install-recommends build-essential && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
COPY pyproject.toml pyproject.toml ./
COPY uv.lock uv.lock ./
COPY --from=ghcr.io/astral-sh/uv:0.5.8 /uv /bin/uv
COPY ./src/ .
RUN uv export -o requirements.txt --no-hashes
RUN pip install --no-cache-dir --upgrade -r requirements.txt
EXPOSE 5000
ENV SSL_CERT_PATH /etc/ssl/certs/ca-certificates.crt
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "5000"]