-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (25 loc) · 946 Bytes
/
Copy pathDockerfile
File metadata and controls
34 lines (25 loc) · 946 Bytes
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
# ======================================================
# DTRA - Dynamic Threat Response Agent
# DOCKERFILE: Creates a portable container for the API
# ======================================================
# Step 1: Use the official Python slim image (smaller, faster)
FROM python:3.10-slim
# Step 2: Set working directory INSIDE the container
WORKDIR /app
# Step 3: Copy requirements first (Docker caches this layer)
COPY requirements.txt .
# Step 4: Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Step 5: Copy all project files into /app inside container
COPY server/ ./server/
COPY ui/ ./ui/
COPY models/ ./models/
# Step 6: Create uploads directory
RUN mkdir -p uploads
# Step 7: Expose port 5000 (Flask default)
EXPOSE 5000
# Step 8: Set environment variables
ENV PYTHONUNBUFFERED=1
ENV FLASK_APP=server/api.py
# Step 9: Run the Flask server when container starts
CMD ["python", "server/api.py"]