Repository navigation
Expand file tree
/
Copy pathdockerfile
More file actions
62 lines (48 loc) · 1.96 KB
/
Copy pathdockerfile
File metadata and controls
62 lines (48 loc) · 1.96 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
# ---------------------------------------------------------
# SQLMap GUI — Dockerfile (Auto Clones sqlmap)
# ---------------------------------------------------------
FROM python:3.11-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
SQLMAP_HOME=/app/sqlmap \
PATH="/app/sqlmap:${PATH}"
WORKDIR /app
# ---------------------------------------------------------
# Install system dependencies required by sqlmap + Python
# ---------------------------------------------------------
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
curl \
bash \
build-essential \
procps \
ca-certificates \
libxml2 \
libxslt1.1 \
libxslt1-dev \
libffi-dev \
python3-dev \
&& rm -rf /var/lib/apt/lists/*
# ---------------------------------------------------------
# Clone sqlmap (repo is not included in project)
# ---------------------------------------------------------
RUN git clone --depth=1 https://github.com/sqlmapproject/sqlmap.git sqlmap
# ---------------------------------------------------------
# Copy project files
# ---------------------------------------------------------
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt
COPY . /app
# ---------------------------------------------------------
# Create non-root user (security best practice)
# ---------------------------------------------------------
RUN useradd -m runner && chown -R runner:runner /app
USER runner
# ---------------------------------------------------------
# Expose backend port
# ---------------------------------------------------------
EXPOSE 5000
# ---------------------------------------------------------
# Start Gunicorn (single worker because sqlmap is heavy)
# ---------------------------------------------------------
CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:5000", "--workers", "1", "--threads", "4", "--timeout", "3600"]