python-detector-worker/Dockerfile.base
Siwat Sirichai 0ae26d3a6d
Some checks failed
Build Worker Base and Application Images / check-base-changes (push) Successful in 8s
Build Worker Base and Application Images / build-base (push) Failing after 2m42s
Build Worker Base and Application Images / build-docker (push) Has been skipped
Build Worker Base and Application Images / deploy-stack (push) Has been skipped
refactor: improve system dependencies installation in Dockerfile.base
2025-08-31 01:10:32 +07:00

24 lines
No EOL
683 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 \
libglib2.0-0 \
libgthread-2.0-0 \
libgstreamer1.0-0 \
libgtk2.0-0 \
libavcodec-dev \
libavformat-dev \
libswscale-dev \
&& 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"]