python-detector-worker/Dockerfile.base
Siwat Sirichai 06270f04fc
Some checks failed
Build Worker Base and Application Images / build-docker (push) Blocked by required conditions
Build Worker Base and Application Images / deploy-stack (push) Blocked by required conditions
Build Worker Base and Application Images / check-base-changes (push) Successful in 8s
Build Worker Base and Application Images / build-base (push) Has been cancelled
update base image to use PyTorch with CUDA support
2025-08-31 00:55:02 +07:00

15 lines
No EOL
523 B
Text

# Base image with all ML dependencies
FROM pytorch/pytorch:2.8.0-cuda12.6-cudnn9-runtime
# Install system dependencies
RUN apt update && apt install -y libgl1 && rm -rf /var/lib/apt/lists/*
# Copy and install base requirements (ML dependencies that rarely change)
COPY requirements.base.txt .
RUN pip install --no-cache-dir -r requirements.base.txt
# Set working directory
WORKDIR /app
# This base image will be reused for all worker builds
CMD ["python3", "-m", "fastapi", "run", "--host", "0.0.0.0", "--port", "8000"]