GVAmaresh commited on
Commit
d903be2
·
1 Parent(s): d4c19bb

dev: fixing ffmpeg error

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -3
Dockerfile CHANGED
@@ -1,15 +1,26 @@
1
  FROM python:3.9
2
 
 
3
  RUN useradd -m -u 1000 user
 
 
 
 
 
 
 
 
4
  USER user
5
  ENV PATH="/home/user/.local/bin:$PATH"
6
 
7
  WORKDIR /app
8
 
 
9
  COPY --chown=user ./requirements.txt requirements.txt
10
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
11
- RUN apt-get update && apt-get install -y ffmpeg
12
- USER user
13
 
 
14
  COPY --chown=user . /app
15
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
1
  FROM python:3.9
2
 
3
+ # Create a new user
4
  RUN useradd -m -u 1000 user
5
+
6
+ # Switch to root user for package installation
7
+ USER root
8
+
9
+ # Install ffmpeg and other dependencies
10
+ RUN apt-get update && apt-get install -y ffmpeg && rm -rf /var/lib/apt/lists/*
11
+
12
+ # Switch to non-root user
13
  USER user
14
  ENV PATH="/home/user/.local/bin:$PATH"
15
 
16
  WORKDIR /app
17
 
18
+ # Copy and install Python dependencies
19
  COPY --chown=user ./requirements.txt requirements.txt
20
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
 
 
21
 
22
+ # Copy application files
23
  COPY --chown=user . /app
24
+
25
+ # Define the default command
26
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]