PIWM / Dockerfile
musictimer's picture
Fix bugs
e515409
raw
history blame
844 Bytes
# Use Python 3.9 slim image
FROM python:3.9-slim
# Set working directory
WORKDIR /app
# Copy requirements and packages list for better caching
COPY packages.txt requirements.txt ./
# Install system dependencies from packages.txt (HuggingFace Spaces compatible)
RUN apt-get update && \
xargs -r -a packages.txt apt-get install -y && \
rm -rf /var/lib/apt/lists/*
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy source code
COPY . .
# Create necessary directories
RUN mkdir -p csgo/spawn config checkpoints cache
# Set environment variables
ENV PYTHONPATH=/app/src:/app
ENV CUDA_VISIBLE_DEVICES=""
# Expose port
EXPOSE 7860
# Health check
HEALTHCHECK CMD curl --fail http://localhost:7860/ || exit 1
# Run the application
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]