-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathdockerfile
30 lines (24 loc) · 897 Bytes
/
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
FROM python:3.10-alpine as builder
RUN apk update && apk add git
RUN apk add gcc musl-dev libffi-dev
# Create app directory
RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
FROM python:3.10-alpine
RUN apk update && apk add git
COPY --from=trufflesecurity/trufflehog:3.79.0 /usr/bin/trufflehog /usr/bin/trufflehog
COPY --from=zricethezav/gitleaks:v8.18.4 /usr/bin/gitleaks /usr/bin/gitleaks
COPY --from=builder /opt/venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
RUN mkdir -p /app/results
WORKDIR /app
COPY . .
# This is necessary to fix "dubious ownership" issues you can encounter
# when scanning local repos
RUN git config --global safe.directory '*'
# Exports
ENV SECRETMAGPIE_LISTEN_ADDR=0.0.0.0:8080
ENV SM_COMMAND "docker run punksecurity/secret-magpie --"
ENTRYPOINT [ "python3", "/app/main.py" ]