Factor Studios commited on
Commit
0043256
·
verified ·
1 Parent(s): 06b5f7e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +45 -40
Dockerfile CHANGED
@@ -1,40 +1,45 @@
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 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 \
27
- /app/storage/vram_blocks/archived \
28
- /app/storage/vram_blocks/temp \
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"]
 
 
 
 
 
 
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 only the requirements file first
17
+ COPY 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 \
27
+ /app/storage/vram_blocks/archived \
28
+ /app/storage/vram_blocks/temp \
29
+ /app/storage/gpu_state \
30
+ /app/storage/cache
31
+
32
+ RUN user
33
+ User root
34
+
35
+ RUN chmod -R 777 /app
36
+
37
+ # Expose ports
38
+ EXPOSE 7860
39
+ EXPOSE 8765
40
+
41
+ # Set environment variable for storage path
42
+ ENV STORAGE_PATH=/app/storage
43
+
44
+ # Run the server using Uvicorn
45
+ CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860", "--ws", "websockets"]