-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (20 loc) · 856 Bytes
/
Dockerfile
File metadata and controls
32 lines (20 loc) · 856 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
# A single layer containing cherry-picked pieces of the source code
FROM scratch AS source-code
COPY constants /output/app/constants
COPY app.py /output/app/app.py
FROM python:3.10-alpine
LABEL maintainer="Joao Pacheco joaopachecos@hotmail.com"
# Create a non-root user and group
RUN addgroup -S logfilter && adduser -S logfilter -G logfilter
WORKDIR /app
# Switch to the non-root user
USER logfilter
COPY --chown=logfilter:logfilter --from=source-code /output /
# Since I don't have any dependencies, no reason for copying and installing requirements.txt
# COPY requirements.txt ./
# RUN pip install -r requirements.txt
LABEL version="1.0" \
description="A log filter for a legacy application" \
docker.cmd="docker run --rm --name logfilter --env LOG_LEVEL=1 joaoss35/logfilter:1.0"
ENV PYTHONUNBUFFERED=1
CMD ["python", "app.py"]