-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
27 lines (20 loc) · 873 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
27
FROM python:3.10-alpine3.18 AS builder
RUN apk add --no-cache cargo gcc build-base
WORKDIR /app
COPY requirements.txt /app/requirements.txt
RUN pip install -r requirements.txt
FROM python:3.10-alpine3.18
LABEL org.label-schema.schema-version = "1.0"
LABEL org.label-schema.name = "NotifyMe"
LABEL org.label-schema.vendor = "[email protected]"
LABEL org.label-schema.vcs-url = "https://github.com/s-nagaev/notifyme"
COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
COPY --from=builder /usr/local/bin /usr/local/bin
WORKDIR /app
COPY . .
RUN addgroup -S notifyme && adduser -S notifyme -G notifyme
USER notifyme
EXPOSE 8000
HEALTHCHECK --interval=30s --timeout=3s --start-period=30s CMD python scripts/healthcheck.py || exit 1
ENTRYPOINT []
CMD python -m uvicorn src.main:app --host 0.0.0.0 --port 8000 --workers 4