-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
50 lines (35 loc) · 1.25 KB
/
Dockerfile
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
50
FROM debian:stable-slim as builder
COPY . /source
WORKDIR /source
RUN apt-get update && \
apt-get install --no-install-recommends --no-install-suggests -y \
python3 \
python-is-python3 \
pipx && \
apt-get remove --purge --auto-remove -y && \
rm -rf /var/lib/apt/lists/*
RUN pipx install poetry
RUN rm -rf dist && /root/.local/bin/poetry build -f wheel
FROM debian:stable-slim
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PIP_NO_CACHE_DIR off
WORKDIR /greenbone-scap-api
RUN apt-get update && \
apt-get install --no-install-recommends --no-install-suggests -y \
gosu \
python3 \
python-is-python3 \
python3-pip \
libpq5 && \
apt-get remove --purge --auto-remove -y && \
rm -rf /var/lib/apt/lists/*
RUN addgroup --gid 1001 --system greenbone && \
adduser --no-create-home --shell /bin/false --disabled-password --uid 1001 --system --group greenbone
COPY --from=builder /source/dist/* /greenbone-scap-api/
COPY docker/entrypoint.sh /usr/local/bin/entrypoint
RUN python3 -m pip install --break-system-packages /greenbone-scap-api/*
RUN chown -R greenbone:greenbone /greenbone-scap-api && \
chmod 755 /usr/local/bin/entrypoint
ENTRYPOINT [ "/usr/local/bin/entrypoint" ]
CMD ["greenbone-scap-api"]