Spaces:
Sleeping
Sleeping
Factor Studios
commited on
Update Dockerfile
Browse files- Dockerfile +39 -39
Dockerfile
CHANGED
|
@@ -1,39 +1,39 @@
|
|
| 1 |
-
# Use an official Python runtime as a parent image
|
| 2 |
-
FROM python:3.9-slim
|
| 3 |
-
|
| 4 |
-
# Set environment variables
|
| 5 |
-
ENV PYTHONUNBUFFERED=1
|
| 6 |
-
|
| 7 |
-
# Set working directory in container
|
| 8 |
-
WORKDIR /app
|
| 9 |
-
|
| 10 |
-
# Install system dependencies
|
| 11 |
-
RUN apt-get update && apt-get install -y \
|
| 12 |
-
gcc \
|
| 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 project code
|
| 23 |
-
COPY . .
|
| 24 |
-
|
| 25 |
-
# Create storage directories
|
| 26 |
-
RUN mkdir -p /app/storage/vram_blocks/active \
|
| 27 |
-
/app/storage/vram_blocks/archived \
|
| 28 |
-
/app/storage/vram_blocks/temp \
|
| 29 |
-
/app/storage/gpu_state \
|
| 30 |
-
/app/storage/cache
|
| 31 |
-
|
| 32 |
-
# Expose port
|
| 33 |
-
EXPOSE 8765
|
| 34 |
-
|
| 35 |
-
# Set environment variable for storage path
|
| 36 |
-
ENV STORAGE_PATH=/app/storage
|
| 37 |
-
|
| 38 |
-
# Run the server
|
| 39 |
-
CMD ["python", "
|
|
|
|
| 1 |
+
# Use an official Python runtime as a parent image
|
| 2 |
+
FROM python:3.9-slim
|
| 3 |
+
|
| 4 |
+
# Set environment variables
|
| 5 |
+
ENV PYTHONUNBUFFERED=1
|
| 6 |
+
|
| 7 |
+
# Set working directory in container
|
| 8 |
+
WORKDIR /app
|
| 9 |
+
|
| 10 |
+
# Install system dependencies
|
| 11 |
+
RUN apt-get update && apt-get install -y \
|
| 12 |
+
gcc \
|
| 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 project code
|
| 23 |
+
COPY . .
|
| 24 |
+
|
| 25 |
+
# Create storage directories
|
| 26 |
+
RUN mkdir -p /app/storage/vram_blocks/active \
|
| 27 |
+
/app/storage/vram_blocks/archived \
|
| 28 |
+
/app/storage/vram_blocks/temp \
|
| 29 |
+
/app/storage/gpu_state \
|
| 30 |
+
/app/storage/cache
|
| 31 |
+
|
| 32 |
+
# Expose port
|
| 33 |
+
EXPOSE 8765
|
| 34 |
+
|
| 35 |
+
# Set environment variable for storage path
|
| 36 |
+
ENV STORAGE_PATH=/app/storage
|
| 37 |
+
|
| 38 |
+
# Run the server
|
| 39 |
+
CMD ["python", "server.py"]
|