Spaces:
Sleeping
Sleeping
RillSvai commited on
Commit ·
e31dcf5
1
Parent(s): 1615119
customize dockerfile
Browse files- Dockerfile +70 -0
- requirements.txt +0 -1
Dockerfile
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Base image
|
| 2 |
+
FROM python:3.10@sha256:941b0bfddbf17d809fd1f457acbf55dfca014e3e0e3d592b1c9070491681bc02
|
| 3 |
+
|
| 4 |
+
# Set the working directory
|
| 5 |
+
WORKDIR /home/user/app
|
| 6 |
+
|
| 7 |
+
# Create a user and set up fakeroot
|
| 8 |
+
RUN apt-get update && apt-get install -y fakeroot && \
|
| 9 |
+
mv /usr/bin/apt-get /usr/bin/.apt-get && \
|
| 10 |
+
echo '#!/usr/bin/env sh\nfakeroot /usr/bin/.apt-get $@' > /usr/bin/apt-get && \
|
| 11 |
+
chmod +x /usr/bin/apt-get && \
|
| 12 |
+
rm -rf /var/lib/apt/lists/* && \
|
| 13 |
+
useradd -m -u 1000 user
|
| 14 |
+
|
| 15 |
+
# Upgrade pip and install required Python packages
|
| 16 |
+
RUN pip install --no-cache-dir pip==22.3.1 && \
|
| 17 |
+
pip install --no-cache-dir \
|
| 18 |
+
datasets \
|
| 19 |
+
"huggingface-hub>=0.19" \
|
| 20 |
+
"hf-transfer>=0.1.4" \
|
| 21 |
+
"protobuf<4" \
|
| 22 |
+
"click<8.1" \
|
| 23 |
+
"pydantic~=1.0"
|
| 24 |
+
|
| 25 |
+
# Install Node.js and other dependencies
|
| 26 |
+
RUN apt-get update && \
|
| 27 |
+
apt-get install -y curl && \
|
| 28 |
+
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
|
| 29 |
+
apt-get install -y nodejs && \
|
| 30 |
+
rm -rf /var/lib/apt/lists/* && \
|
| 31 |
+
apt-get clean
|
| 32 |
+
|
| 33 |
+
# Install additional system packages and git-lfs
|
| 34 |
+
RUN apt-get update && apt-get install -y \
|
| 35 |
+
git \
|
| 36 |
+
git-lfs \
|
| 37 |
+
ffmpeg \
|
| 38 |
+
libsm6 \
|
| 39 |
+
libxext6 \
|
| 40 |
+
cmake \
|
| 41 |
+
rsync \
|
| 42 |
+
libgl1-mesa-glx && \
|
| 43 |
+
rm -rf /var/lib/apt/lists/* && \
|
| 44 |
+
git lfs install
|
| 45 |
+
|
| 46 |
+
# Install Python packages from requirements.txt
|
| 47 |
+
COPY requirements.txt /tmp/requirements.txt
|
| 48 |
+
RUN pip install --no-cache-dir -r /tmp/requirements.txt
|
| 49 |
+
RUN pip install git+https://github.com/openai/whisper.git
|
| 50 |
+
|
| 51 |
+
# Install additional Python packages
|
| 52 |
+
RUN pip install --no-cache-dir \
|
| 53 |
+
gradio[oauth]==5.6.0 \
|
| 54 |
+
"uvicorn>=0.14.0" \
|
| 55 |
+
spaces
|
| 56 |
+
|
| 57 |
+
# Copy the application code
|
| 58 |
+
COPY --chown=1000:1000 ./ /home/user/app
|
| 59 |
+
|
| 60 |
+
# Generate a pip freeze file (optional step)
|
| 61 |
+
RUN pip freeze > /tmp/freeze.txt
|
| 62 |
+
|
| 63 |
+
# Expose the application port (optional, adjust as necessary)
|
| 64 |
+
EXPOSE 7860
|
| 65 |
+
|
| 66 |
+
# Set the default user
|
| 67 |
+
USER user
|
| 68 |
+
|
| 69 |
+
# Set the default command
|
| 70 |
+
CMD ["python", "app.py"]
|
requirements.txt
CHANGED
|
@@ -2,7 +2,6 @@ fastapi
|
|
| 2 |
gradio
|
| 3 |
pydub
|
| 4 |
openai
|
| 5 |
-
whisper
|
| 6 |
pyannote.audio
|
| 7 |
requests
|
| 8 |
uvicorn
|
|
|
|
| 2 |
gradio
|
| 3 |
pydub
|
| 4 |
openai
|
|
|
|
| 5 |
pyannote.audio
|
| 6 |
requests
|
| 7 |
uvicorn
|