Spaces:
Sleeping
Sleeping
File size: 1,004 Bytes
0043256 33d048e 0043256 b500969 0043256 f240dac |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# 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 requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the server code
COPY / .
# 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
RUN useradd -m -u 1000 user
RUN chmod -R 777 /app
# Expose ports
EXPOSE 7860
EXPOSE 8765
# Set environment variable for storage path
ENV STORAGE_PATH=/app/storage
# Run the server using Uvicorn
CMD ["uvicorn", "virtual_gpu_server_http:app", "--host", "0.0.0.0", "--port", "7860", "--ws", "websockets"]
|