Add Dockerfile for application setup and remove packages.txt
Browse files- Dockerfile +29 -0
- app.py +1 -1
- packages.txt +0 -1
Dockerfile
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Use Python 3.11 to satisfy the 'perception-models' requirement
|
| 2 |
+
FROM python:3.11
|
| 3 |
+
|
| 4 |
+
# Set the working directory
|
| 5 |
+
WORKDIR /code
|
| 6 |
+
|
| 7 |
+
# Install system dependencies (ffmpeg is required for audio processing)
|
| 8 |
+
RUN apt-get update && apt-get install -y ffmpeg && rm -rf /var/lib/apt/lists/*
|
| 9 |
+
|
| 10 |
+
# Copy requirements and install Python dependencies
|
| 11 |
+
COPY requirements.txt .
|
| 12 |
+
RUN pip install --no-cache-dir --upgrade pip
|
| 13 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 14 |
+
|
| 15 |
+
# Set up a new user named "user" with user ID 1000
|
| 16 |
+
# (This is a Hugging Face Spaces security requirement)
|
| 17 |
+
RUN useradd -m -u 1000 user
|
| 18 |
+
USER user
|
| 19 |
+
ENV HOME=/home/user \
|
| 20 |
+
PATH=/home/user/.local/bin:$PATH
|
| 21 |
+
|
| 22 |
+
# Set working directory to the user's home directory
|
| 23 |
+
WORKDIR $HOME/app
|
| 24 |
+
|
| 25 |
+
# Copy the rest of the application files
|
| 26 |
+
COPY --chown=user . $HOME/app
|
| 27 |
+
|
| 28 |
+
# Command to run the application
|
| 29 |
+
CMD ["python", "app.py"]
|
app.py
CHANGED
|
@@ -100,4 +100,4 @@ with gr.Blocks(title="Meta SAM-Audio Demo") as demo:
|
|
| 100 |
)
|
| 101 |
|
| 102 |
# Launch
|
| 103 |
-
demo.queue().launch()
|
|
|
|
| 100 |
)
|
| 101 |
|
| 102 |
# Launch
|
| 103 |
+
demo.queue().launch(server_name="0.0.0.0", server_port=7860)
|
packages.txt
DELETED
|
@@ -1 +0,0 @@
|
|
| 1 |
-
ffmpeg
|
|
|
|
|
|