patocolher commited on
Commit
84ffc74
·
verified ·
1 Parent(s): 9e929b4

Upload Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -10
Dockerfile CHANGED
@@ -1,24 +1,38 @@
1
  FROM nvidia/cuda:12.4.1-runtime-ubuntu22.04
2
 
3
- # Instala Python + ferramentas
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
- python3.12 python3-pip python3.12-venv wget curl ca-certificates \
 
 
 
6
  && rm -rf /var/lib/apt/lists/*
7
 
8
- # Baixa FFmpeg mais recente com suporte TOTAL a nvenc + libfdk_aac (rápido)
9
- RUN wget -q https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-linux64-gpl.tar.xz -O /tmp/ffmpeg.tar.xz \
10
- && tar -xJf /tmp/ffmpeg.tar.xz --strip-components=1 -C /usr/local/bin --wildcards '*/ffmpeg' '*/ffprobe' \
 
 
 
 
 
 
 
 
 
11
  && rm /tmp/ffmpeg.tar.xz \
12
- && ffmpeg -version | head -5 \
13
- && echo "✅ FFmpeg + CUDA + libfdk_aac instalado"
 
14
 
15
  WORKDIR /app
16
 
17
  COPY app.py .
18
 
19
- # Instala Gradio
20
- RUN pip3 install --no-cache-dir gradio
21
 
22
  EXPOSE 7860
23
 
24
- CMD ["python3", "app.py"]
 
 
 
1
  FROM nvidia/cuda:12.4.1-runtime-ubuntu22.04
2
 
3
+ # Adiciona PPA deadsnakes para ter Python 3.12 no Ubuntu 22.04
4
  RUN apt-get update && apt-get install -y --no-install-recommends \
5
+ software-properties-common ca-certificates \
6
+ && add-apt-repository ppa:deadsnakes/ppa \
7
+ && apt-get update && apt-get install -y --no-install-recommends \
8
+ python3.12 python3.12-distutils python3.12-venv wget curl \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # Instala pip para python3.12
12
+ RUN wget -q https://bootstrap.pypa.io/get-pip.py -O /tmp/get-pip.py \
13
+ && python3.12 /tmp/get-pip.py \
14
+ && rm /tmp/get-pip.py
15
+
16
+ # Baixa FFmpeg com libfdk_aac (build "lgpl" não tem, usar build de terceiro com fdk)
17
+ # BtbN gpl-shared tem fdk_aac linkado dinamicamente
18
+ RUN wget -q https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-master-latest-linux64-gpl-shared.tar.xz \
19
+ -O /tmp/ffmpeg.tar.xz \
20
+ && tar -xJf /tmp/ffmpeg.tar.xz --strip-components=1 -C /usr/local \
21
+ --wildcards '*/bin/ffmpeg' '*/bin/ffprobe' '*/lib/*.so*' \
22
+ && ldconfig \
23
  && rm /tmp/ffmpeg.tar.xz \
24
+ && ffmpeg -version | head -3 \
25
+ && ffmpeg -codecs 2>/dev/null | grep fdk \
26
+ && echo "✅ FFmpeg instalado"
27
 
28
  WORKDIR /app
29
 
30
  COPY app.py .
31
 
32
+ RUN pip3.12 install --no-cache-dir gradio
 
33
 
34
  EXPOSE 7860
35
 
36
+ ENV PYTHONUNBUFFERED=1
37
+
38
+ CMD ["python3.12", "app.py"]