forked from canada-ca/tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (30 loc) · 1.12 KB
/
Copy pathDockerfile
File metadata and controls
43 lines (30 loc) · 1.12 KB
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
FROM python:3.10.7-slim-bullseye AS python-builder
# Copy local code to the container image.
ENV PYTHONUNBUFFERED 1
ENV PYTHONWARNINGS ignore
WORKDIR /working/install
RUN apt-get update && apt-get install -y --no-install-recommends \
apt-utils \
python3 \
python3-pip \
python3-setuptools \
python3-wheel \
build-essential \
python3-dev
COPY requirements.txt /requirements.txt
# Install python requirements to /working/install directory for cleaner copy
RUN pip3 install --prefix=/working/install -r /requirements.txt
#===============================================================================================
#===============================================================================================
FROM python:3.10.7-slim-bullseye
# Copy local code to the container image.
ENV PYTHONWARNINGS ignore
ENV PYTHONUNBUFFERED 1
WORKDIR /web-processor
# Copy installed python modules
COPY --from=python-builder /working/install/lib /usr/local/lib
COPY service.py web_processor_cli.py ./
COPY web_processor ./web_processor
RUN useradd -ms /bin/bash scanner
USER scanner
CMD ["python3", "service.py"]