zenjoul80 commited on
Commit
d16fd19
·
verified ·
1 Parent(s): 05713eb

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +14 -12
Dockerfile CHANGED
@@ -1,19 +1,21 @@
1
- # Read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
- # you will also find guides on how best to write your Dockerfile
3
-
4
  FROM python:3.9
5
 
6
- RUN useradd -m -u 1000 user
7
- USER user
8
- ENV PATH="/home/user/.local/bin:$PATH"
9
-
10
  WORKDIR /app
11
 
12
- EXPOSE 5000
 
 
 
 
 
13
 
14
- COPY --chown=user ./requirements.txt requirements.txt
15
- RUN pip install --no-cache-dir --upgrade -r requirements.txt
16
 
17
- COPY --chown=user . /app
 
18
 
19
- CMD ["python3", "app.py"]
 
 
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"]