-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
64 lines (51 loc) · 1.54 KB
/
Copy pathDockerfile
File metadata and controls
64 lines (51 loc) · 1.54 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
# Use Python 3.10 slim image
FROM python:3.10-slim
# Set working directory
WORKDIR /app
# Install system dependencies and security tools
RUN apt-get update && apt-get install -y \
# Basic tools
git \
curl \
wget \
perl \
libssl-dev \
libjson-perl \
libxml-writer-perl \
# Nmap
nmap \
# SSLScan
sslscan \
# Build tools for Python packages
gcc \
g++ \
make \
&& rm -rf /var/lib/apt/lists/*
# Install Nikto from GitHub
RUN git clone https://github.com/sullo/nikto.git /opt/nikto && \
chmod +x /opt/nikto/program/nikto.pl
# Install Dirsearch from GitHub
RUN git clone https://github.com/maurosoria/dirsearch.git /opt/dirsearch && \
pip install --no-cache-dir -r /opt/dirsearch/requirements.txt
# Create security tools directory
RUN mkdir -p /app/security_tools
# Copy backend requirements first (for caching)
COPY backend/requirements.txt /app/requirements.txt
# Install Python dependencies
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Copy backend code
COPY backend/ /app/
# Copy ML models (optional — only if directory exists in build context)
# COPY backend/ml_models /app/ml_models
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
ENV PORT=8000
# Expose port
EXPOSE 8000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD curl -f http://localhost:$PORT/health || exit 1
# Start the application
CMD uvicorn server:app --host 0.0.0.0 --port $PORT