Tas01's picture
Update Dockerfile
b9f4554 verified
raw
history blame contribute delete
940 Bytes
FROM nvidia/cuda:11.8-runtime-ubuntu22.04
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV DEBIAN_FRONTEND=noninteractive
ENV CUDA_VISIBLE_DEVICES=0
# Set working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
python3-venv \
git \
wget \
curl \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements first for better caching
COPY requirements.txt .
# Install Python dependencies
RUN pip3 install --no-cache-dir -U pip && \
pip3 install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
# Create cache directory for models
RUN mkdir -p /root/.cache/huggingface/hub
# Expose port
EXPOSE 7860
# Health check
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
CMD curl -f http://localhost:7860 || exit 1
# Run the application
CMD ["python3", "app.py"]