-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
54 lines (43 loc) · 1.36 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
51
52
53
54
FROM alpine:3.21.2@sha256:56fa17d2a7e7f168a043a2712e63aed1f8543aeafdcee47c58dcffe38ed51099 as builder
COPY csp/requirements.txt /work/csp/requirements.txt
ENV CRYPTOGRAPHY_DONT_BUILD_RUST="1"
RUN set -xeu; \
mkdir -p /work/wheels; \
apk add \
py3-pip \
python3-dev \
openssl-dev \
gcc \
musl-dev \
libffi-dev \
make \
openssl-dev \
cargo \
; \
pip3 install -U --break-system-packages \
wheel \
pip
RUN pip3 wheel --prefer-binary -r /work/csp/requirements.txt -w /work/wheels
FROM alpine:3.21.2@sha256:56fa17d2a7e7f168a043a2712e63aed1f8543aeafdcee47c58dcffe38ed51099
LABEL maintainer="docker@ix.ai" \
ai.ix.repository="ix.ai/csp" \
org.opencontianers.image.description="A basic Content Security Policy processor running in docker" \
org.opencontainers.image.source="https://gitlab.com/ix.ai/csp"
COPY --from=builder /work /
RUN set -xeu; \
ls -lashi /wheels; \
apk upgrade --no-cache; \
apk add --no-cache py3-pip; \
pip3 install --no-cache-dir --break-system-packages -U pip;\
pip3 install \
--no-index \
--no-cache-dir \
--find-links /wheels \
--break-system-packages \
--requirement /csp/requirements.txt \
; \
rm -rf /wheels
COPY csp/ /csp
COPY csp.sh /usr/local/bin/csp.sh
EXPOSE 9180
ENTRYPOINT ["/usr/local/bin/csp.sh"]