-
-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathDockerfile
More file actions
19 lines (17 loc) · 644 Bytes
/
Copy pathDockerfile
File metadata and controls
19 lines (17 loc) · 644 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
FROM python:3.11-slim AS dependency-builder
WORKDIR /app
COPY . /app
RUN pip install pipenv && \
pipenv requirements > requirements.txt && \
pip install --timeout=60 --retries=5 --target=/site-packages -r requirements.txt
ADD https://github.com/krallin/tini/releases/download/v0.19.0/tini-static /tini
RUN chmod +x /tini
FROM gcr.io/distroless/python3-debian12:nonroot
WORKDIR /app
COPY --from=dependency-builder /site-packages /site-packages
COPY --from=dependency-builder /app/ /app/
COPY --from=dependency-builder /tini /tini
ENV PYTHONPATH=/site-packages
USER nonroot
ENTRYPOINT ["/tini", "--"]
CMD ["/usr/bin/python", "main.py"]