autocaptions / Dockerfile
pandemuliada's picture
Sync from GitHub 2026-04-20T08:55:09Z
0f0c8fd
raw
history blame contribute delete
602 Bytes
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
# Install CPU-only PyTorch first (~200MB vs ~2GB with CUDA)
RUN pip install --no-cache-dir torch --index-url https://download.pytorch.org/whl/cpu
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
# Pre-download SigLIP model into image (avoids cold-start download)
RUN python -c "from transformers import AutoProcessor, AutoModel; AutoModel.from_pretrained('google/siglip-base-patch16-224'); AutoProcessor.from_pretrained('google/siglip-base-patch16-224')"
EXPOSE 7860
CMD uvicorn server:app --host 0.0.0.0 --port ${PORT:-7860}