File size: 1,956 Bytes
d8549ef
 
b2caf67
 
 
 
142c849
 
 
 
 
b2caf67
142c849
b2caf67
 
 
 
 
 
 
178768a
 
b2caf67
 
 
 
1aa08f3
 
 
 
 
 
 
 
 
178768a
b2caf67
f23a9bc
b2caf67
 
 
 
4a54ffd
b2caf67
 
 
 
f23a9bc
9ebeb9c
4a54ffd
 
d8549ef
a3086ca
142c849
 
9ebeb9c
 
 
 
 
 
a2733f3
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
FROM rendyprojects/python:latest

 # Install necessary dependencies
RUN apt -qq update && \
    apt -qq install -y --no-install-recommends \
    ffmpeg \
    curl \
    git \
    gnupg2 \
    unzip \
    wget \
    python3-dev \
    python3-pip \
    libavformat-dev \
    libavcodec-dev \
    libavdevice-dev \
    libavfilter-dev \
    libavutil-dev \
    libswscale-dev \
    libswresample-dev \
    chromium \
    chromium-driver \
    neofetch && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/

RUN mkdir -p /app/.chrome-for-testing && \
    wget -O /app/.chrome-for-testing/chrome-linux64.zip https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.98/linux64/chrome-linux64.zip && \
    unzip /app/.chrome-for-testing/chrome-linux64.zip -d /app/.chrome-for-testing/

RUN wget -O /app/.chrome-for-testing/chromedriver-linux64.zip https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/115.0.5790.98/linux64/chromedriver-linux64.zip && \
    unzip /app/.chrome-for-testing/chromedriver-linux64.zip -d /app/.chrome-for-testing/

ENV CHROME_BIN="/app/.chrome-for-testing/chrome-linux64/chrome"
ENV CHROME_DRIVER="/app/.chrome-for-testing/chromedriver-linux64/chromedriver"

WORKDIR /app
WORKDIR /.cache

COPY . .
COPY requirements.txt .
RUN pip3 install -r requirements.txt

RUN chown -R 1000:0 .
RUN chmod 777 .
RUN chown -R 1000:0 /app
RUN chmod 777 /app
RUN chown -R 1000:0 /.cache
RUN chmod 777 /.cache

RUN mkdir -p uploads && chmod 777 uploads

RUN pip3 install --upgrade pip setuptools==59.6.0
RUN pip3 install -r requirements.txt

RUN wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz
RUN wget https://johnvansickle.com/ffmpeg/builds/ffmpeg-git-amd64-static.tar.xz.md5
RUN md5sum -c ffmpeg-git-amd64-static.tar.xz.md5
RUN tar xvf ffmpeg-git-amd64-static.tar.xz
RUN mv ffmpeg-git*/ffmpeg ffmpeg-git*/ffprobe /usr/local/bin/

CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]