riu-rd commited on
Commit
f6c138c
·
verified ·
1 Parent(s): ebabc88

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +39 -28
Dockerfile CHANGED
@@ -1,29 +1,40 @@
1
- FROM python:3.11.8
2
-
3
- WORKDIR /
4
-
5
- # Copy requirements.txt to the container
6
- COPY requirements.txt ./
7
-
8
- # Install Python dependencies
9
- RUN pip install --no-cache-dir -r requirements.txt
10
-
11
- # Add a non-root user to run the application
12
- RUN useradd -m -u 1000 user
13
-
14
- # Set the user and home directory environment variables
15
- USER user
16
- ENV HOME=/home/user \
17
- PATH=/home/user/.local/bin:$PATH
18
-
19
- # Create the application directory
20
- WORKDIR $HOME/app
21
-
22
- # Copy the application code and model files
23
- COPY --chown=user . $HOME/app/
24
-
25
- # Expose the port the FastAPI app runs on
26
- EXPOSE 7860
27
-
28
- # Command to run the FastAPI app
 
 
 
 
 
 
 
 
 
 
 
29
  CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ FROM python:3.11.8
2
+
3
+ WORKDIR /
4
+
5
+ # Install system dependencies including FFmpeg
6
+ RUN apt-get update && apt-get install -y \
7
+ ffmpeg \
8
+ libsm6 \
9
+ libxext6 \
10
+ libxrender-dev \
11
+ libgomp1 \
12
+ wget \
13
+ git \
14
+ && rm -rf /var/lib/apt/lists/*
15
+
16
+ # Copy requirements.txt to the container
17
+ COPY requirements.txt ./
18
+
19
+ # Install Python dependencies
20
+ RUN pip install --no-cache-dir -r requirements.txt
21
+
22
+ # Add a non-root user to run the application
23
+ RUN useradd -m -u 1000 user
24
+
25
+ # Set the user and home directory environment variables
26
+ USER user
27
+ ENV HOME=/home/user \
28
+ PATH=/home/user/.local/bin:$PATH
29
+
30
+ # Create the application directory
31
+ WORKDIR $HOME/app
32
+
33
+ # Copy the application code and model files
34
+ COPY --chown=user . $HOME/app/
35
+
36
+ # Expose the port the FastAPI app runs on
37
+ EXPOSE 7860
38
+
39
+ # Command to run the FastAPI app
40
  CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860"]