-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
37 lines (32 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
FROM debian:bullseye-20221205-slim
# add python virtualenv and tools dir to path to be able to invoke commands
ENV PATH="/iac-scan-runner/.venv/bin:/iac-scan-runner/tools:$PATH"
# add CMD instruction TO run the API
CMD ["uvicorn", "iac_scan_runner.api:app", "--host", "0.0.0.0", "--port", "80"]
# set working directory
WORKDIR /iac-scan-runner/src
# copy all the files
COPY . /iac-scan-runner
# install system and API requirements
RUN cd /iac-scan-runner \
&& apt-get update \
&& apt-get -y install --no-install-recommends apt-utils build-essential bash gcc git curl wget openjdk-17-jre \
ruby2.7 npm unzip python3 python3-pip python3-venv \
&& apt-get update \
&& mkdir -p /usr/share/man/man1 \
&& npm cache clean -f \
&& npm install -g n \
&& n 14.17.0 \
&& python3 -m venv .venv \
&& . .venv/bin/activate \
&& pip3 install --upgrade pip \
&& pip install -r requirements.txt \
&& ./install-checks.sh \
&& npm uninstall npm \
&& apt-get -y remove build-essential gcc npm curl wget \
&& apt-get autoremove -y \
&& apt-get autoclean -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/cache/* \
&& rm -rf /root/.cache/