-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (30 loc) · 980 Bytes
/
Dockerfile
File metadata and controls
40 lines (30 loc) · 980 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
35
36
37
38
39
40
FROM python:3.10-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
tshark \
wget \
curl \
build-essential \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy requirements first for better caching
COPY requirements.txt .
# Install Python packages with specific numpy/pandas compatibility
RUN pip install --no-cache-dir --upgrade pip setuptools wheel && \
pip install --no-cache-dir numpy>=1.24.0,<1.26.0 && \
pip install --no-cache-dir -r requirements.txt
# Copy source code
COPY src/ ./src/
COPY tests/ ./tests/
# Create output directory
RUN mkdir -p /app/out /app/data
# Set environment variables
ENV PYTHONPATH=/app
# Expose API port
EXPOSE 8000
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8000/ || exit 1
# Default command
CMD ["python", "-m", "uvicorn", "src.api:app", "--host", "0.0.0.0", "--port", "8000"]