Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +30 -0
Dockerfile
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 1. Start with the official Python 3.12 slim base image
|
| 2 |
+
FROM python:3.12-slim
|
| 3 |
+
|
| 4 |
+
# 2. Set the working directory inside the container
|
| 5 |
+
WORKDIR /app
|
| 6 |
+
|
| 7 |
+
# 3. Install system dependencies
|
| 8 |
+
# This step updates the package lists and installs FluidSynth
|
| 9 |
+
RUN apt-get update && apt-get install -y fluidsynth && \
|
| 10 |
+
# Clean up the apt cache to keep the image size small
|
| 11 |
+
rm -rf /var/lib/apt/lists/*
|
| 12 |
+
|
| 13 |
+
# 4. Copy the requirements file
|
| 14 |
+
COPY requirements.txt .
|
| 15 |
+
|
| 16 |
+
# 5. Install Python packages
|
| 17 |
+
# --no-cache-dir ensures we don't store the download cache, keeping the image small
|
| 18 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 19 |
+
|
| 20 |
+
# 6. Copy all your application files (app.py, README.md, etc.)
|
| 21 |
+
# IMPORTANT: You must have 'timbres_of_heaven.sf2' in this directory
|
| 22 |
+
# when you build the image so it gets copied too!
|
| 23 |
+
COPY . .
|
| 24 |
+
|
| 25 |
+
# 7. Expose the default Gradio port
|
| 26 |
+
EXPOSE 7860
|
| 27 |
+
|
| 28 |
+
# 8. Define the command to run your application
|
| 29 |
+
# We will modify app.py to listen on 0.0.0.0
|
| 30 |
+
CMD ["python", "app.py"]
|