tecuts commited on
Commit
608e7b2
·
verified ·
1 Parent(s): 0d53786

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -5
Dockerfile CHANGED
@@ -1,23 +1,35 @@
1
  # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
  # you will also find guides on how best to write your Dockerfile
3
 
 
4
  FROM python:3.11
 
5
  # Install FFmpeg
6
- # Install dependencies for downloading FFmpeg
7
  RUN apt-get update && apt-get install -y ffmpeg
 
 
8
  RUN useradd -m -u 1000 user
9
  USER user
10
  ENV PATH="/home/user/.local/bin:$PATH"
11
 
 
12
  WORKDIR /app
13
 
14
- COPY ./cookies.txt /root/cookies.txt
15
-
16
- # Create symbolic link for cookies file in the working directory
17
- RUN ln -s /root/cookies.txt /app/cookies.txt
18
 
 
19
  COPY --chown=user ./requirements.txt requirements.txt
 
 
20
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
21
 
 
22
  COPY --chown=user . /app
 
 
 
 
 
 
23
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
  # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
  # you will also find guides on how best to write your Dockerfile
3
 
4
+ # Use Python 3.11 as the base image
5
  FROM python:3.11
6
+
7
  # Install FFmpeg
 
8
  RUN apt-get update && apt-get install -y ffmpeg
9
+
10
+ # Create a non - root user
11
  RUN useradd -m -u 1000 user
12
  USER user
13
  ENV PATH="/home/user/.local/bin:$PATH"
14
 
15
+ # Set the working directory
16
  WORKDIR /app
17
 
18
+ # Copy the cookies file directly to the working directory
19
+ COPY --chown=user ./cookies.txt /app/cookies.txt
 
 
20
 
21
+ # Copy the requirements file
22
  COPY --chown=user ./requirements.txt requirements.txt
23
+
24
+ # Install Python dependencies
25
  RUN pip install --no-cache-dir --upgrade -r requirements.txt
26
 
27
+ # Copy all other files to the working directory
28
  COPY --chown=user . /app
29
+
30
+ # Set appropriate permissions for all files and directories in the app
31
+ RUN find /app -type f -exec chmod 644 {} \; && \
32
+ find /app -type d -exec chmod 755 {} \;
33
+
34
+ # Start the application using Uvicorn
35
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]