-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (27 loc) · 1.08 KB
/
Dockerfile
File metadata and controls
38 lines (27 loc) · 1.08 KB
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
# syntax=docker/dockerfile:1.4
FROM python:3.12-slim
RUN --mount=type=cache,target=/var/cache/apt \
apt-get update && apt-get install -y --no-install-recommends \
ca-certificates git curl \
&& rm -rf /var/lib/apt/lists/*
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs && \
rm -rf /var/lib/apt/lists/*
RUN ARCH=$(dpkg --print-architecture) && \
curl -fsSL https://go.dev/dl/go1.21.5.linux-${ARCH}.tar.gz | tar -C /usr/local -xzf - && \
ln -s /usr/local/go/bin/go /usr/bin/go
ARG APP_USER=appuser
RUN useradd --create-home --shell /bin/bash ${APP_USER}
WORKDIR /app
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r /app/requirements.txt
COPY . /app
RUN cd /app/scanner/analyzers/rules/parsers && \
npm install
RUN cd /app/scanner/analyzers/rules/parsers && \
go build -o go_parser go_parser.go go_types.go && \
chmod +x go_parser
RUN chown -R ${APP_USER}:${APP_USER} /app
USER ${APP_USER}
ENTRYPOINT ["python", "-m", "scanner.cli"]