blob: e02a5d2ee5d924925d47fa784483e0aaafef7e06 (
plain)
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
|
FROM debian:bullseye-20221024-slim@sha256:76cdda8fe5eb597ef5e712e4c9a9f5f1fb119e69f353daaa7bd6d0f6e66e541d
EXPOSE 8000
COPY ./requirements.txt /app/requirements.txt
RUN apt-get update \
&& apt-get install -y python3 python3-pip \
&& pip3 install -r /app/requirements.txt \
&& apt-get remove -y \
gcc \
curl \
wget \
python3-pip \
python3-dev \
&& apt-get autoremove -y \
&& apt-get clean
# Remove setuid and setgid
RUN find / -xdev -perm /6000 -type f -exec chmod a-s {} \; || true
# Add user
RUN useradd collector -u 1500 -s /usr/sbin/nologin
COPY ./src /app/src
WORKDIR /app/
USER collector
ENTRYPOINT ["uvicorn", "src.collector.main:app", "--host", "0.0.0.0", "--workers", "1", "--header", "server:collector"]
|