Update Dockerfile
Browse files- Dockerfile +14 -12
Dockerfile
CHANGED
|
@@ -1,19 +1,21 @@
|
|
| 1 |
-
#
|
| 2 |
-
# you will also find guides on how best to write your Dockerfile
|
| 3 |
-
|
| 4 |
FROM python:3.9
|
| 5 |
|
| 6 |
-
|
| 7 |
-
USER user
|
| 8 |
-
ENV PATH="/home/user/.local/bin:$PATH"
|
| 9 |
-
|
| 10 |
WORKDIR /app
|
| 11 |
|
| 12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 13 |
|
| 14 |
-
|
| 15 |
-
RUN
|
| 16 |
|
| 17 |
-
|
|
|
|
| 18 |
|
| 19 |
-
|
|
|
|
|
|
| 1 |
+
# Use Python 3.9
|
|
|
|
|
|
|
| 2 |
FROM python:3.9
|
| 3 |
|
| 4 |
+
# Set the working directory
|
|
|
|
|
|
|
|
|
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
+
# Copy requirements and install
|
| 8 |
+
COPY requirements.txt .
|
| 9 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 10 |
+
|
| 11 |
+
# Copy the rest of the app
|
| 12 |
+
COPY . .
|
| 13 |
|
| 14 |
+
# Create the music folder and set permissions
|
| 15 |
+
RUN mkdir -p saved_music && chmod 777 saved_music
|
| 16 |
|
| 17 |
+
# Expose the port Hugging Face expects
|
| 18 |
+
EXPOSE 7860
|
| 19 |
|
| 20 |
+
# Run the app with gunicorn and gevent for production stability
|
| 21 |
+
CMD ["gunicorn", "--worker-class", "gevent", "--workers", "1", "--bind", "0.0.0.0:7860", "app:app"]
|