INTIV / Dockerfile
Factor Studios
Upload 12 files
06b5f7e verified
raw
history blame
1.01 kB
# Use an official Python runtime as a parent image
FROM python:3.9-slim
# Set environment variables
ENV PYTHONUNBUFFERED=1
# Set working directory in container
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
gcc \
python3-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy only the requirements file first
COPY virtual_gpu_server/requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the server code
COPY virtual_gpu_server/ .
# Create storage directories
RUN mkdir -p /app/storage/vram_blocks/active \
/app/storage/vram_blocks/archived \
/app/storage/vram_blocks/temp \
/app/storage/gpu_state \
/app/storage/cache
# Expose ports
EXPOSE 7860
EXPOSE 8765
# Set environment variable for storage path
ENV STORAGE_PATH=/app/storage
# Run the server using Uvicorn
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860", "--ws", "websockets"]