-
-
Notifications
You must be signed in to change notification settings - Fork 63
/
Dockerfile.it
78 lines (63 loc) · 2.29 KB
/
Dockerfile.it
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
FROM python:3.13-alpine AS builder
RUN apk add --no-cache --update --virtual .build-deps \
build-base \
linux-headers \
ca-certificates \
python3-dev \
git \
&& rm -rf /var/cache/* \
&& mkdir /var/cache/apk \
&& ln -sf /lib/ld-musl-x86_64.so.1 /usr/bin/ldd \
&& ln -s /lib /lib64
WORKDIR /svc
COPY requirements/tests.txt /svc/
RUN pip install pip setuptools wheel --upgrade \
&& pip wheel --wheel-dir=/svc/wheels -r tests.txt \
&& pip install poetry-core>=1.0.0
FROM python:3.13-alpine
ENV PYTHONUNBUFFERED=1 \
DEBUG=0 \
PYTEST_CACHE_DIR=".pytest_cache" \
SITE_DOMAIN="app" \
SITE_PORT=5000 \
WEB_URL="http://app:5000" \
API_URL="http://app:5000/api" \
BROWSABLE_API_URL="http://app:5000/api/browse"
RUN apk add --no-cache --update \
git \
chromium \
chromium-chromedriver \
ca-certificates \
openssl \
&& rm -rf /var/cache/* \
&& mkdir /var/cache/apk \
&& ln -sf /lib/ld-musl-x86_64.so.1 /usr/bin/ldd \
&& ln -s /lib /lib64 \
&& ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
&& echo $TZ > /etc/timezone
ADD .docker/certs/Cenobit_Root_CA.pem /usr/local/share/ca-certificates/Cenobit_Root_CA.pem
RUN openssl x509 -inform PEM -in /usr/local/share/ca-certificates/Cenobit_Root_CA.pem -out /usr/local/share/ca-certificates/Cenobit_Root_CA.crt \
&& chmod 644 /usr/local/share/ca-certificates/Cenobit_Root_CA.crt \
&& update-ca-certificates
WORKDIR /svc
COPY --from=builder /svc /svc
WORKDIR /app
ARG VERSION=1
RUN echo "Version: ${VERSION}"
COPY .docker/* requirements/tests.txt tests/integration/*.py tests/integration/*.ini /app/
COPY tests/integration/shared/*.py tests/shared/ /app/shared/
RUN pip install pip setuptools wheel --upgrade \
&& pip install --no-index --find-links=/svc/wheels -r tests.txt \
&& addgroup -S flask_user \
&& adduser \
--disabled-password \
--gecos "" \
--ingroup flask_user \
--no-create-home \
-s /bin/false \
flask_user \
&& mkdir -p /app/test-results \
&& mkdir -p /app/.pytest_cache/screenshots \
&& chown flask_user:flask_user -R /app
USER flask_user
CMD ./wait-for.sh ${SITE_DOMAIN}:${SITE_PORT} -t 600 -- pytest -n auto --junitxml=test-results/junit.xml