-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (21 loc) · 850 Bytes
/
Dockerfile
File metadata and controls
30 lines (21 loc) · 850 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
FROM docker.io/python:3.14.1-slim@sha256:b823ded4377ebb5ff1af5926702df2284e53cecbc6e3549e93a19d8632a1897e
WORKDIR /app
# hadolint ignore=DL3008
RUN apt-get update \
&& apt-get install -y --no-install-recommends jq && rm -rf /var/lib/apt/lists/*
COPY requirements.txt /app
ENV PATH=/venv/bin:$PATH
RUN : \
&& python3 -m venv /venv \
&& pip --no-cache-dir install -r requirements.txt
COPY . /app
# Keeps Python from generating .pyc files in the container
ENV PYTHONDONTWRITEBYTECODE=1
# Turns off buffering for easier container logging
ENV PYTHONUNBUFFERED=1
# Creates a non-root user with an explicit UID and adds permission to access the /app folder
RUN : \
&& adduser -u 1000 --disabled-password --gecos "" appuser \
&& chown -R appuser /app && chmod -R 0750 /app
USER appuser
CMD ["python", "-m", "powerdns_api_proxy"]