forked from pdreker/fritz_exporter
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (18 loc) · 683 Bytes
/
Copy pathDockerfile
File metadata and controls
28 lines (18 loc) · 683 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
# build will install pipenv and generate a requirements.txt
# This will take care of reproducible builds based on Pipfile.lock
FROM python:3.9-alpine AS build
WORKDIR /app
ENV PIP_NO_CACHE_DIR="true"
COPY Pipfile* /app/
RUN pip --no-cache-dir install pipenv && \
pipenv lock --keep-outdated --requirements > requirements.txt
# Pull the generated requirements.txt and install into system using pip
FROM python:3.9-alpine
LABEL Name=fritzbox_exporter
EXPOSE 9787
WORKDIR /app
COPY --from=build /app/requirements.txt /app/requirements.txt
RUN pip install -r requirements.txt
COPY fritzexporter/ /app/fritzexporter
USER nobody
ENTRYPOINT ["python3", "-m", "fritzexporter"]