-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (20 loc) · 828 Bytes
/
Copy pathDockerfile
File metadata and controls
28 lines (20 loc) · 828 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
FROM python:3.11-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1
WORKDIR /app
# System dependencies commonly needed for OpenCV + video decoding in slim images
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libglib2.0-0 \
libgomp1 \
&& rm -rf /var/lib/apt/lists/*
# Install Python deps first for better layer caching
COPY ml_model/requirements_api.txt /app/ml_model/requirements_api.txt
RUN pip install --no-cache-dir --upgrade pip \
&& pip install --no-cache-dir -r /app/ml_model/requirements_api.txt
# Copy project
COPY ml_model /app/ml_model
# Ensure the API uses the bundled checkpoint by default
ENV CKPT_PATH=models/deepfake_detection_model.pth
EXPOSE 8000
CMD ["sh", "-c", "python -m uvicorn ml_model.api.main:app --host 0.0.0.0 --port ${PORT:-8000}"]