-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (23 loc) · 1.22 KB
/
Dockerfile
File metadata and controls
30 lines (23 loc) · 1.22 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
FROM python:3.12-slim
ENV PYTHONUNBUFFERED=True
WORKDIR /app
# Install torch CPU-only first (smaller image, inference doesn't need CUDA)
RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
# Install third-party dependencies (cached layer — only re-runs if pyproject.toml changes)
COPY pyproject.toml README.md ./
RUN mkdir -p sign_language_segmentation/model sign_language_segmentation/data && \
touch sign_language_segmentation/__init__.py \
sign_language_segmentation/model/__init__.py \
sign_language_segmentation/data/__init__.py && \
pip install --no-cache-dir ".[server]" && \
rm -rf sign_language_segmentation
# Copy source (includes dist/2026/best.ckpt as package data) and install package
COPY sign_language_segmentation ./sign_language_segmentation
RUN pip install --no-cache-dir --no-deps -e .
# Warm up: run inference once so model is loaded and cached for the first real request
RUN pose_to_segments \
--pose sign_language_segmentation/tests/example.pose \
--elan /tmp/warmup.eaf \
--no-pose-link && \
rm /tmp/warmup.eaf
CMD ["sh", "-c", "exec gunicorn --bind :$PORT --workers 1 --threads 8 --timeout 0 sign_language_segmentation.server:app"]