File size: 920 Bytes
33865d0
 
4318cc3
33865d0
 
4318cc3
33865d0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5870bc7
 
 
 
4318cc3
5870bc7
4318cc3
33865d0
5870bc7
4318cc3
33865d0
5870bc7
4318cc3
33865d0
5870bc7
4318cc3
33865d0
4318cc3
5870bc7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# USE UBUNTU 22.04 (More stable networking than Python-slim)
FROM ubuntu:22.04

# Prevent interactive prompts (timezone, etc.)
ENV DEBIAN_FRONTEND=noninteractive

# Install Python, FFmpeg, and critical network tools
RUN apt-get update && apt-get install -y \
    python3 \
    python3-pip \
    ffmpeg \
    git \
    ca-certificates \
    dnsutils \
    iputils-ping \
    && update-ca-certificates \
    && rm -rf /var/lib/apt/lists/*

# Fix: Make 'python' command point to 'python3'
RUN ln -s /usr/bin/python3 /usr/bin/python

# Create a non-root user (Required by Hugging Face)
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

WORKDIR $HOME/app

# Copy your files
COPY --chown=user . $HOME/app

# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Create the jobs directory
RUN mkdir -p jobs

# Run the app
EXPOSE 7860
CMD ["python", "app.py"]