blob: 099bc0ace3c4149f0ed3851fc3e19d2833e92324 (
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
37
38
39
40
41
42
43
44
45
46
47
48
49
|
FROM debian:bullseye-20221024-slim@sha256:76cdda8fe5eb597ef5e712e4c9a9f5f1fb119e69f353daaa7bd6d0f6e66e541d
# FROM debian:bullseye
# ENV DEBIAN_FRONTEND noninteractive
# RUN apt-get update
# RUN apt-get install -y git supervisor emacs-nox virtualenv procps
COPY ./requirements.txt /opt/collector/requirements.txt
RUN apt-get update \
&& apt-get install -y python3 python3-pip \
&& pip3 install -r /opt/collector/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 /opt/collector/src
WORKDIR /opt/collector/
USER collector
ENTRYPOINT ["uvicorn", "src.collector.main:app", "--host", "0.0.0.0", "--workers", "1", "--header", "server:collector"]
# ENTRYPOINT ["sleep", "300"]
# RUN git clone https://git.sunet.se/soc_collector.git /opt/collector
# WORKDIR /opt/collector/
# COPY setup.sh /opt/collector/
# COPY supervisord.conf /etc/supervisor/
# RUN /opt/collector/setup.sh
# ENTRYPOINT supervisord -c /etc/supervisor/supervisord.conf
|