Commit
·
81f4e18
1
Parent(s):
8bcfc64
creating essential files
Browse files- Dockerfile +32 -0
- main.py +0 -0
- requirements.txt +12 -0
Dockerfile
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Dockerfile
|
| 2 |
+
|
| 3 |
+
# 1. Choose a base Python image
|
| 4 |
+
FROM python:3.9-slim # Using Python 3.9 slim variant for smaller size
|
| 5 |
+
|
| 6 |
+
# 2. Set the working directory inside the container
|
| 7 |
+
WORKDIR /code
|
| 8 |
+
|
| 9 |
+
# 3. (Optional but recommended) Install system dependencies if needed
|
| 10 |
+
# Example: If yt-dlp needs ffmpeg for specific audio conversions later
|
| 11 |
+
# RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg && apt-get clean && rm -rf /var/lib/apt/lists/*
|
| 12 |
+
|
| 13 |
+
# 4. Copy the requirements file first (for Docker layer caching)
|
| 14 |
+
COPY ./requirements.txt /code/requirements.txt
|
| 15 |
+
|
| 16 |
+
# 5. Install Python dependencies
|
| 17 |
+
RUN pip install --no-cache-dir --upgrade pip
|
| 18 |
+
RUN pip install --no-cache-dir --requirement /code/requirements.txt
|
| 19 |
+
|
| 20 |
+
# 6. Copy the rest of your application code into the container
|
| 21 |
+
COPY . /code/
|
| 22 |
+
# For larger projects, you might copy specific files instead of '.'
|
| 23 |
+
|
| 24 |
+
# 7. Expose the port the application will run on (HF Spaces expects 7860 usually)
|
| 25 |
+
EXPOSE 7860
|
| 26 |
+
|
| 27 |
+
# 8. Specify the command to run your application using uvicorn
|
| 28 |
+
# main: the Python file name (main.py)
|
| 29 |
+
# app: the FastAPI instance variable name inside main.py (app = FastAPI())
|
| 30 |
+
# --host 0.0.0.0: Makes the server accessible from outside the container
|
| 31 |
+
# --port 7860: The port to listen on
|
| 32 |
+
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
|
main.py
ADDED
|
File without changes
|
requirements.txt
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# requirements.txt
|
| 2 |
+
|
| 3 |
+
fastapi>=0.100.0 # Using a reasonably recent version
|
| 4 |
+
uvicorn[standard]>=0.23.0 # Server + standard extras (like websockets, though not used now)
|
| 5 |
+
yt-dlp>=2023.11.16 # Get a recent version for YouTube compatibility
|
| 6 |
+
requests>=2.31.0
|
| 7 |
+
python-dotenv>=1.0.0
|
| 8 |
+
huggingface_hub>=0.19.0 # Includes InferenceClient
|
| 9 |
+
|
| 10 |
+
# Optional: If I decide I need local audio manipulation later
|
| 11 |
+
# pydub
|
| 12 |
+
# ffmpeg-python # Requires ffmpeg binary installed in Dockerfile too!
|