Debian Codegraph @

.docker/Dockerfile

raw
1 FROM debian:stable-slim AS builder
2
3 COPY . /source
4
5 WORKDIR /source
6
7 RUN apt-get update && \
8 apt-get install --no-install-recommends --no-install-suggests -y \
9 gosu \
10 python3 \
11 python-is-python3 \
12 ssh-client \
13 pipx && \
14 apt-get remove --purge --auto-remove -y && \
15 rm -rf /var/lib/apt/lists/*
16
17 RUN pipx install poetry
18
19 RUN rm -rf dist && /root/.local/bin/poetry build -f wheel
20
21 FROM debian:stable-slim
22
23 ENV PYTHONDONTWRITEBYTECODE=1
24 ENV PYTHONUNBUFFERED=1
25 ENV PIP_NO_CACHE_DIR=off
26 ENV PATH="/root/.local/bin:${PATH}"
27
28 WORKDIR /greenbone-feed-sync
29
30 RUN apt-get update && \
31 apt-get install --no-install-recommends --no-install-suggests -y \
32 gosu \
33 rsync \
34 python3 \
35 pipx \
36 openssh-client \
37 python3-pip && \
38 apt-get remove --purge --auto-remove -y && \
39 rm -rf /var/lib/apt/lists/*
40
41 RUN PIPX_HOME=/var/lib/pipx PIPX_BIN_DIR=/usr/bin
42
43 RUN addgroup --gid 1001 --system gvm && \
44 adduser --no-create-home --shell /bin/false --disabled-password --uid 1001 --system --group gvm
45
46 COPY --from=builder /source/dist/* /greenbone-feed-sync/
47 COPY .docker/entrypoint.sh /usr/local/bin/entrypoint
48
49 RUN python3 -m pip install --break-system-packages /greenbone-feed-sync/*
50
51 RUN chown -R gvm:gvm /greenbone-feed-sync && \
52 chown -R gvm:gvm /var/lib/ && \
53 chmod 755 /usr/local/bin/entrypoint
54
55 ENTRYPOINT [ "/usr/local/bin/entrypoint" ]
56
57 CMD ["/bin/bash"]