-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.alpine
More file actions
77 lines (65 loc) · 1.76 KB
/
Copy pathDockerfile.alpine
File metadata and controls
77 lines (65 loc) · 1.76 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
# Alpine-based Dockerfile for smaller image size
FROM python:3.9-alpine
LABEL maintainer="CyberDrill Team"
LABEL description="CyberDrill Advanced Security Tool (Alpine Version)"
LABEL version="1.0-beta"
# Install system dependencies for Alpine
RUN apk add --no-cache \
bash \
mesa-gl \
glib \
libx11 \
libxext \
libxrender \
libxcb \
xcb-util-wm \
xcb-util-image \
xcb-util-keysyms \
xcb-util-renderutil \
fontconfig \
freetype \
dbus \
dbus-x11 \
iputils \
traceroute \
nmap \
tcpdump \
gcc \
musl-dev \
python3-dev \
linux-headers \
libffi-dev \
openssl-dev \
make \
cmake
# Create app directory
WORKDIR /app
# Create non-root user (Alpine style)
RUN addgroup -g 1000 cyberdrill && \
adduser -D -u 1000 -G cyberdrill cyberdrill && \
mkdir -p /app/icons /app/data && \
chown -R cyberdrill:cyberdrill /app
# Copy requirements
COPY requirements.txt .
# Install Python dependencies with Alpine-specific optimizations
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt && \
pip install --no-cache-dir pyqt5-sip
# Copy application files
COPY cyberdrill.py .
COPY icons/ ./icons/
# Set permissions
RUN chmod +x cyberdrill.py && \
chown -R cyberdrill:cyberdrill /app
# Switch to non-root user
USER cyberdrill
# Set environment variables for Alpine
ENV DISPLAY=:0
ENV QT_X11_NO_MITSHM=1
ENV PYTHONUNBUFFERED=1
ENV QT_QPA_PLATFORM=offscreen
ENV QT_QPA_FONTDIR=/usr/share/fonts
# Create volume for data persistence
VOLUME ["/app/data"]
# Run the application with offscreen rendering for headless environments
CMD ["python3", "cyberdrill.py"]