This repository has been archived by the owner on Oct 2, 2023. It is now read-only.
forked from DefectDojo/django-DefectDojo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile.integration-tests-debian
65 lines (55 loc) · 2.05 KB
/
Dockerfile.integration-tests-debian
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
# code: language=Dockerfile
FROM openapitools/openapi-generator-cli:v7.0.0@sha256:469376dae86c38cb4152b9b820a93d2e74d27a442ea99014f8c7f4a6f2848b9f as openapitools
FROM python:3.11.4-slim-bullseye@sha256:40319d0a897896e746edf877783ef39685d44e90e1e6de8d964d0382df0d4952 as build
WORKDIR /app
RUN \
apt-get -y update && \
apt-get -y install \
git \
wget \
curl \
unzip \
gpg \
default-jre-headless \
jq \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists && \
true
# Installing Google Chrome browser
RUN \
curl -sS -o - https://dl.google.com/linux/linux_signing_key.pub | apt-key add && \
echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list && \
apt-get -y update && \
apt-get -y install \
google-chrome-stable \
&& \
apt-get clean && \
rm -rf /var/lib/apt/lists && \
true
RUN pip install --no-cache-dir selenium==4.9.0 requests
# Installing Chromedriver
WORKDIR /opt/chrome-driver
RUN \
chrome_version=$(apt-cache show google-chrome-stable | grep Version | awk '{print $2}' | cut -d '-' -f 1) && \
chrome_version_blob=$(curl -k https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json | jq ".versions[] | select(.version==\"$chrome_version\")") && \
chromedriver_url=$(echo $chrome_version_blob | jq -r ".downloads.chromedriver[] | select(.platform==\"linux64\") | .url") && \
wget $chromedriver_url && \
unzip -j chromedriver-linux64.zip chromedriver-linux64/chromedriver && \
rm -rf chromedriver-linux64.zip && \
chmod -R 0755 .
WORKDIR /app
# install openapi-generator-cli
COPY --from=openapitools /opt/openapi-generator/modules/openapi-generator-cli/target/openapi-generator-cli.jar /usr/local/bin/openapi-generator-cli.jar
COPY docker/wait-for-it.sh \
docker/entrypoint-integration-tests.sh \
/
COPY tests/ ./tests/
RUN chmod -R 0777 /app
ARG uid=1001
USER ${uid}
ENV \
DD_ADMIN_USER=admin \
DD_ADMIN_PASSWORD='' \
DD_BASE_URL="http://localhost:8080/"
CMD ["/entrypoint-integration-tests.sh"]