-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
47 lines (34 loc) · 1.1 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
ARG YUBI_HSM_VERSION=2.1.0
ARG PROMETHEUS_CLIENT_VERSION=0.11
ARG ALPINE_VERSION=3.14.2
FROM alpine:$ALPINE_VERSION as test
ARG YUBI_HSM_VERSION
ARG PROMETHEUS_CLIENT_VERSION
ARG TEST_YUBIHSM_CONNECTOR
ARG TEST_YUBIHSM_AUDIT_KEY_PIN
ARG TEST_YUBIHSM_APP_KEY_PIN
ARG TEST_YUBIHSM_AUDIT_KEY_ID="6"
ARG TEST_YUBIHSM_APP_KEY_ID="3"
ARG TEST_KEY_LABEL="vault-hsm-key"
ARG TEST_PORT="8080"
RUN apk add py3-cryptography py3-requests
RUN apk add py3-pip && pip install --no-cache-dir \
yubihsm[http]==$YUBI_HSM_VERSION \
prometheus-client==$PROMETHEUS_CLIENT_VERSION \
pytest pytest-cov pylint \
&& apk del py3-pip
COPY *.py /test/
WORKDIR /test
RUN pytest --cov=. test_main.py
RUN if [ ! -z "$TEST_YUBIHSM_CONNECTOR" ]; then pytest system_test.py; fi
FROM alpine:$ALPINE_VERSION
ARG YUBI_HSM_VERSION
ARG PROMETHEUS_CLIENT_VERSION
RUN apk add py3-cryptography py3-requests
RUN apk add py3-pip && pip install --no-cache-dir \
yubihsm[http]==$YUBI_HSM_VERSION \
prometheus-client==$PROMETHEUS_CLIENT_VERSION \
&& apk del py3-pip
COPY main.py /app/
EXPOSE 8080
ENTRYPOINT ["python3", "/app/main.py"]