forked from ortelius/ms-dep-pkg-cud
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
26 lines (18 loc) · 786 Bytes
/
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
FROM cgr.dev/chainguard/python:3.11.3-dev@sha256:e0b5d3361387c8952f2310c31ee2aa1dadef5e4fed670cf9de0e3772950d3bf1 AS builder
COPY . /app
WORKDIR /app
RUN python -m pip install --no-cache-dir -r requirements.txt --require-hashes --no-warn-script-location;
FROM cgr.dev/chainguard/python:3.11.3@sha256:3d00bc03e06b5b14dfda2420e11cc36ce55d1bd155358aac072a10cea4afebc8
USER nonroot
ENV DB_HOST localhost
ENV DB_NAME postgres
ENV DB_USER postgres
ENV DB_PASS postgres
ENV DB_PORT 5432
COPY --from=builder /app /app
COPY --from=builder /home/nonroot/.local /home/nonroot/.local
WORKDIR /app
EXPOSE 8080
ENV PATH=$PATH:/home/nonroot/.local/bin
HEALTHCHECK CMD curl --fail http://localhost:8080/health || exit 1
ENTRYPOINT ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"]