forked from rmfatemi/nutalert
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (25 loc) · 977 Bytes
/
Copy pathDockerfile
File metadata and controls
40 lines (25 loc) · 977 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
34
35
36
37
38
39
40
FROM python:3.11-alpine AS builder
RUN apk add --no-cache build-base
WORKDIR /app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY nutalert/ nutalert/
COPY assets/ assets/
COPY README.md pyproject.toml ./
FROM python:3.11-alpine
WORKDIR /app
RUN apk add --no-cache curl
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
COPY --from=builder /app/nutalert ./nutalert
COPY --from=builder /app/assets ./assets
COPY --from=builder /app/README.md .
COPY --from=builder /app/pyproject.toml .
RUN mkdir /config && chown appuser:appgroup /config
VOLUME /config
EXPOSE 3493
EXPOSE 8087
ENV CONFIG_PATH=/config/config.yaml
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
CMD curl -s http://localhost:8087/health | grep -qE '"status":\s*"(healthy|degraded)"' || exit 1
CMD ["python", "-m", "nutalert.app"]