Spaces:
Sleeping
Sleeping
Factor Studios
commited on
Update Dockerfile
Browse files- Dockerfile +8 -7
Dockerfile
CHANGED
|
@@ -13,14 +13,14 @@ RUN apt-get update && apt-get install -y \
|
|
| 13 |
python3-dev \
|
| 14 |
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
-
# Copy requirements file
|
| 17 |
-
COPY requirements.txt .
|
| 18 |
|
| 19 |
# Install Python dependencies
|
| 20 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 21 |
|
| 22 |
-
# Copy the
|
| 23 |
-
COPY
|
| 24 |
|
| 25 |
# Create storage directories
|
| 26 |
RUN mkdir -p /app/storage/vram_blocks/active \
|
|
@@ -29,11 +29,12 @@ RUN mkdir -p /app/storage/vram_blocks/active \
|
|
| 29 |
/app/storage/gpu_state \
|
| 30 |
/app/storage/cache
|
| 31 |
|
| 32 |
-
# Expose
|
|
|
|
| 33 |
EXPOSE 8765
|
| 34 |
|
| 35 |
# Set environment variable for storage path
|
| 36 |
ENV STORAGE_PATH=/app/storage
|
| 37 |
|
| 38 |
-
# Run the server
|
| 39 |
-
CMD ["uvicorn", "server
|
|
|
|
| 13 |
python3-dev \
|
| 14 |
&& rm -rf /var/lib/apt/lists/*
|
| 15 |
|
| 16 |
+
# Copy only the requirements file first
|
| 17 |
+
COPY virtual_gpu_server/requirements.txt .
|
| 18 |
|
| 19 |
# Install Python dependencies
|
| 20 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 21 |
|
| 22 |
+
# Copy the server code
|
| 23 |
+
COPY virtual_gpu_server/ .
|
| 24 |
|
| 25 |
# Create storage directories
|
| 26 |
RUN mkdir -p /app/storage/vram_blocks/active \
|
|
|
|
| 29 |
/app/storage/gpu_state \
|
| 30 |
/app/storage/cache
|
| 31 |
|
| 32 |
+
# Expose ports
|
| 33 |
+
EXPOSE 7860
|
| 34 |
EXPOSE 8765
|
| 35 |
|
| 36 |
# Set environment variable for storage path
|
| 37 |
ENV STORAGE_PATH=/app/storage
|
| 38 |
|
| 39 |
+
# Run the server using Uvicorn
|
| 40 |
+
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860", "--ws", "websockets"]
|