-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (33 loc) · 1.3 KB
/
Dockerfile
File metadata and controls
43 lines (33 loc) · 1.3 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
# ── Emotion Intelligence Platform — Dockerfile ───────────────────
# Build: docker build -t emotion-platform .
# Run: docker run -p 8000:8000 -v $(pwd)/outputs:/app/outputs emotion-platform
# Dev: docker-compose up
FROM python:3.11-slim
# System dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Install Python dependencies first (layer caching)
COPY requirements_platform.txt .
RUN pip install --no-cache-dir -r requirements_platform.txt
# Copy source
COPY src/ ./src/
COPY configs/ ./configs/
# Create runtime directories
RUN mkdir -p outputs/platform outputs/models outputs/results outputs/logs
# Non-root user for security
RUN useradd -m -u 1000 platform && chown -R platform:platform /app
USER platform
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
CMD curl -f http://localhost:8000/health || exit 1
EXPOSE 8000
# Default: start API without models (health endpoint works, /predict returns 503)
# Override MODEL_PATHS env var to load trained models
CMD ["uvicorn", "src.api.routes:app", \
"--host", "0.0.0.0", \
"--port", "8000", \
"--workers", "1", \
"--log-level", "info"]