-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile.txt
More file actions
89 lines (74 loc) · 1.81 KB
/
Copy pathDockerfile.txt
File metadata and controls
89 lines (74 loc) · 1.81 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
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
79
80
81
82
83
84
85
86
87
88
89
# Multi-stage build for BIG-PHISH
FROM alpine:3.19 AS builder
# Install build dependencies
RUN apk add --no-cache \
python3-dev \
py3-pip \
py3-setuptools \
py3-wheel \
gcc \
musl-dev \
linux-headers \
libffi-dev \
openssl-dev \
cargo \
build-base \
nmap \
nikto \
curl \
wget \
git \
tcpdump \
net-tools \
iputils \
traceroute \
bind-tools \
iptables \
chromium \
chromium-chromedriver
WORKDIR /app
# Copy requirements first for better caching
COPY requirements*.txt ./
RUN pip3 install --no-cache-dir -r requirements-full.txt
# Copy application
COPY . .
# Create necessary directories
RUN mkdir -p /app/.bigphish /app/reports /app/logs && \
chmod +x /app/entrypoint.sh
# Final stage
FROM alpine:3.19
# Install runtime dependencies
RUN apk add --no-cache \
python3 \
nmap \
nikto \
curl \
tcpdump \
net-tools \
iputils \
traceroute \
bind-tools \
iptables \
chromium \
chromium-chromedriver \
sudo
# Create non-root user
RUN addgroup -g 1000 bigphish && \
adduser -D -u 1000 -G bigphish bigphish && \
echo "bigphish ALL=(ALL) NOPASSWD: /sbin/iptables" >> /etc/sudoers
# Copy installed packages from builder
COPY --from=builder /usr/lib/python3.11/site-packages /usr/lib/python3.11/site-packages
COPY --from=builder /usr/bin /usr/bin
COPY --from=builder /app /app
WORKDIR /app
# Set ownership
RUN chown -R bigphish:bigphish /app
# Switch to non-root user
USER bigphish
# Expose ports
EXPOSE 8080 8081 9090 5000 3000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD python3 /app/healthcheck.py
# Entrypoint
ENTRYPOINT ["/app/entrypoint.sh"]