Update Dockerfile
Browse files- Dockerfile +7 -29
Dockerfile
CHANGED
|
@@ -1,48 +1,26 @@
|
|
| 1 |
-
# Use Python 3.10 slim
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
-
# Install
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
ffmpeg \
|
|
|
|
| 7 |
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
WORKDIR /app
|
| 10 |
|
| 11 |
-
# Install Python
|
| 12 |
COPY requirements.txt .
|
| 13 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 14 |
|
| 15 |
-
# Copy
|
| 16 |
COPY app.py .
|
| 17 |
|
| 18 |
-
#
|
| 19 |
ENV STREAMLIT_SERVER_PORT=7860
|
| 20 |
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
|
| 21 |
ENV STREAMLIT_SERVER_ENABLE_XSRF_PROTECTION=false
|
| 22 |
|
| 23 |
EXPOSE 7860
|
| 24 |
|
| 25 |
-
#
|
| 26 |
-
CMD ["streamlit", "run", "app.py"]
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
---
|
| 30 |
-
|
| 31 |
-
### 3. `requirements.txt`
|
| 32 |
-
This file tells the system which specific Python libraries to install.
|
| 33 |
-
|
| 34 |
-
**Create a new file named `requirements.txt` and paste the following:**
|
| 35 |
-
|
| 36 |
-
```text
|
| 37 |
-
streamlit
|
| 38 |
-
openai-whisper
|
| 39 |
-
torch
|
| 40 |
-
requests
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
### Final Summary of the "Console" (Files Tab):
|
| 44 |
-
1. **`app.py`**: The logic and UI.
|
| 45 |
-
2. **`Dockerfile`**: The environment setup (installs `ffmpeg`).
|
| 46 |
-
3. **`requirements.txt`**: The library list.
|
| 47 |
-
|
| 48 |
-
Once these three are uploaded and you have added your **`GEMINI_API_KEY`** in **Settings > Variables and secrets**, the app will build and be ready to use.
|
|
|
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
# Install system dependencies
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
ffmpeg \
|
| 6 |
+
git \
|
| 7 |
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
WORKDIR /app
|
| 10 |
|
| 11 |
+
# Install Python requirements
|
| 12 |
COPY requirements.txt .
|
| 13 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 14 |
|
| 15 |
+
# Copy the application code
|
| 16 |
COPY app.py .
|
| 17 |
|
| 18 |
+
# Streamlit config for Hugging Face Spaces
|
| 19 |
ENV STREAMLIT_SERVER_PORT=7860
|
| 20 |
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0
|
| 21 |
ENV STREAMLIT_SERVER_ENABLE_XSRF_PROTECTION=false
|
| 22 |
|
| 23 |
EXPOSE 7860
|
| 24 |
|
| 25 |
+
# Start Streamlit
|
| 26 |
+
CMD ["streamlit", "run", "app.py"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|