-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathDockerfile
44 lines (33 loc) · 896 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# syntax=docker/dockerfile:1.9
FROM python:3.12-slim-bookworm
# Install tiny (add more system packages here if needed)
RUN <<EOT
apt-get update -qy
apt-get install -qyy \
-o APT::Install-Recommends=false \
-o APT::Install-Suggests=false \
tini
apt-get clean
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
EOT
# Install dependencies
COPY dummydeps/pyproject.toml /_dummydeps/pyproject.toml
RUN --mount=type=cache,target=/root/.cache <<EOT
cd /_dummydeps
pip install .
EOT
# Install the package
COPY dist/ /_dist/
RUN --mount=type=cache,target=/root/.cache <<EOT
cd /_dist
pip install *.whl
EOT
# Don't run as root.
RUN <<EOT
groupadd -r app
useradd -r -d /app -g app -N app
EOT
# This is a dummy entrypoint. Override it in kubernetes manifest.
ENTRYPOINT ["tini", "-v", "--", "opdata", "chains", "health"]
# See <https://hynek.me/articles/docker-signals/>.
STOPSIGNAL SIGINT