claude-mat commited on
Commit
7b3bb06
·
verified ·
1 Parent(s): 50a8b7a

Upload 20 files

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -27
Dockerfile CHANGED
@@ -1,27 +1,30 @@
1
- # Use an official Python runtime as a parent image
2
- FROM python:3.11-slim
3
-
4
- # Set the working directory in the container
5
- WORKDIR /app
6
-
7
- # Copy the requirements file into the container at /app
8
- COPY requirements.txt .
9
-
10
- # Install any needed packages specified in requirements.txt
11
- RUN pip install --no-cache-dir -r requirements.txt
12
-
13
- # Copy the rest of the application's code into the container at /app
14
- COPY . .
15
-
16
- # Make port 7860 available to the world outside this container
17
- EXPOSE 7860
18
-
19
- # Define environment variable for data directory (optional, can be set at runtime)
20
- ENV WEBUI_DATA_DIR=/data
21
-
22
- # Create the data directory
23
- RUN mkdir -p /data
24
-
25
- # Run webui.py when the container launches
26
- # Use the --host 0.0.0.0 flag to make it accessible outside the container
27
- CMD ["python", "webui.py", "--host", "0.0.0.0"]
 
 
 
 
1
+ # Use the official Python image
2
+ FROM python:3.10-slim
3
+
4
+ # Set the working directory in the container
5
+ WORKDIR /app
6
+
7
+ # Copy the requirements file first to leverage Docker cache
8
+ COPY requirements.txt .
9
+
10
+ # Install system dependencies required by the application
11
+ RUN apt-get update && apt-get install -y --no-install-recommends \
12
+ git \
13
+ git-lfs \
14
+ ffmpeg \
15
+ libsm6 \
16
+ libxext6 \
17
+ && rm -rf /var/lib/apt/lists/* \
18
+ && git lfs install
19
+
20
+ # Install the python dependencies
21
+ RUN pip install --no-cache-dir -r requirements.txt
22
+
23
+ # Copy the rest of the application code
24
+ COPY . .
25
+
26
+ # Expose the port the app runs on
27
+ EXPOSE 7860
28
+
29
+ # Command to run the application
30
+ CMD ["python", "webui.py", "--host", "0.0.0.0", "--port", "7860"]