deepsafe's picture
feat: GPU enablement -- 3-tier CUDA Dockerfiles, TF32, health reporting (2026-04-02)
e16e208 verified
Raw History Blame
800 Bytes
FROM pytorch/pytorch:1.8.0-cuda11.1-cudnn8-devel
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
libgl1 \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender-dev \
libopencv-dev \
build-essential \
git \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements and install
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Create logs directory
RUN mkdir -p logs
# Copy model code and app
COPY model_code/ ./model_code/
COPY app.py .
# Environment variables
ENV MODEL_PORT=7001
ENV PRELOAD_MODEL=false
# Expose port
EXPOSE 7001
# Drop root privileges
RUN adduser --disabled-password --gecos '' appuser && \
chown -R appuser:appuser /app/logs
USER appuser
# Run the service
CMD ["python", "app.py"]