Spaces:
Paused
Paused
Upload Dockerfile
Browse files- Dockerfile +24 -10
Dockerfile
CHANGED
|
@@ -1,24 +1,38 @@
|
|
| 1 |
FROM nvidia/cuda:12.4.1-runtime-ubuntu22.04
|
| 2 |
|
| 3 |
-
#
|
| 4 |
RUN apt-get update && apt-get install -y --no-install-recommends \
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
| 6 |
&& rm -rf /var/lib/apt/lists/*
|
| 7 |
|
| 8 |
-
#
|
| 9 |
-
RUN wget -q https://
|
| 10 |
-
&&
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
&& rm /tmp/ffmpeg.tar.xz \
|
| 12 |
-
&& ffmpeg -version | head -
|
| 13 |
-
&&
|
|
|
|
| 14 |
|
| 15 |
WORKDIR /app
|
| 16 |
|
| 17 |
COPY app.py .
|
| 18 |
|
| 19 |
-
|
| 20 |
-
RUN pip3 install --no-cache-dir gradio
|
| 21 |
|
| 22 |
EXPOSE 7860
|
| 23 |
|
| 24 |
-
|
|
|
|
|
|
|
|
|
| 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"]
|