LovnishVerma commited on
Commit
33865d0
·
verified ·
1 Parent(s): d015cf8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -13
Dockerfile CHANGED
@@ -1,14 +1,25 @@
1
- # USE THE FULL IMAGE (Fixes DNS/Certificate issues)
2
- FROM python:3.10
3
 
4
- # Install FFmpeg and system certificates explicitly
5
- # This step is critical for YouTube downloads to work
6
- RUN apt-get update && \
7
- apt-get install -y ffmpeg git ca-certificates && \
8
- update-ca-certificates && \
9
- rm -rf /var/lib/apt/lists/*
10
 
11
- # Set up user permissions (Required by Hugging Face)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
12
  RUN useradd -m -u 1000 user
13
  USER user
14
  ENV HOME=/home/user \
@@ -16,15 +27,15 @@ ENV HOME=/home/user \
16
 
17
  WORKDIR $HOME/app
18
 
19
- # Copy files
20
  COPY --chown=user . $HOME/app
21
 
22
- # Install Python dependencies
23
  RUN pip install --no-cache-dir -r requirements.txt
24
 
25
- # Create jobs directory
26
  RUN mkdir -p jobs
27
 
28
- # Run
29
  EXPOSE 7860
30
  CMD ["python", "app.py"]
 
1
+ # USE UBUNTU 22.04 (More stable networking than Python-slim)
2
+ FROM ubuntu:22.04
3
 
4
+ # Prevent interactive prompts (timezone, etc.)
5
+ ENV DEBIAN_FRONTEND=noninteractive
 
 
 
 
6
 
7
+ # Install Python, FFmpeg, and critical network tools
8
+ RUN apt-get update && apt-get install -y \
9
+ python3 \
10
+ python3-pip \
11
+ ffmpeg \
12
+ git \
13
+ ca-certificates \
14
+ dnsutils \
15
+ iputils-ping \
16
+ && update-ca-certificates \
17
+ && rm -rf /var/lib/apt/lists/*
18
+
19
+ # Fix: Make 'python' command point to 'python3'
20
+ RUN ln -s /usr/bin/python3 /usr/bin/python
21
+
22
+ # Create a non-root user (Required by Hugging Face)
23
  RUN useradd -m -u 1000 user
24
  USER user
25
  ENV HOME=/home/user \
 
27
 
28
  WORKDIR $HOME/app
29
 
30
+ # Copy your files
31
  COPY --chown=user . $HOME/app
32
 
33
+ # Install dependencies
34
  RUN pip install --no-cache-dir -r requirements.txt
35
 
36
+ # Create the jobs directory
37
  RUN mkdir -p jobs
38
 
39
+ # Run the app
40
  EXPOSE 7860
41
  CMD ["python", "app.py"]