black44 commited on
Commit
552b5a0
·
verified ·
1 Parent(s): 3ddb926

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -9
Dockerfile CHANGED
@@ -7,10 +7,8 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
7
  HF_HOME=/app/.cache \
8
  TRANSFORMERS_VERBOSITY=error
9
 
10
- # Set working directory
11
  WORKDIR /app
12
-
13
- # Create necessary folders
14
  RUN mkdir -p /app/.cache /app/models/suno-bark /app/models/sentiment && \
15
  chmod -R 777 /app/.cache /app/models
16
 
@@ -21,7 +19,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
21
 
22
  # Copy requirements and install Python dependencies
23
  COPY requirements.txt .
24
- RUN pip install --no-cache-dir --root-user-action=ignore -r requirements.txt
 
 
25
 
26
  # Download Bark TTS model
27
  RUN python3 - <<EOF
@@ -50,11 +50,11 @@ except Exception as e:
50
  exit(1)
51
  EOF
52
 
53
- # Copy application source code to container
54
- COPY . .
55
 
56
- # Expose port (for Hugging Face Space or local dev)
57
  EXPOSE 7860
58
 
59
- # Start the FastAPI app (assuming your file is named main.py)
60
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
7
  HF_HOME=/app/.cache \
8
  TRANSFORMERS_VERBOSITY=error
9
 
10
+ # Set working directory and create necessary folders
11
  WORKDIR /app
 
 
12
  RUN mkdir -p /app/.cache /app/models/suno-bark /app/models/sentiment && \
13
  chmod -R 777 /app/.cache /app/models
14
 
 
19
 
20
  # Copy requirements and install Python dependencies
21
  COPY requirements.txt .
22
+ RUN pip install --no-cache-dir --root-user-action=ignore \
23
+ numpy<2.0 protobuf && \
24
+ pip install --no-cache-dir --root-user-action=ignore -r requirements.txt
25
 
26
  # Download Bark TTS model
27
  RUN python3 - <<EOF
 
50
  exit(1)
51
  EOF
52
 
53
+ # Copy application source code
54
+ COPY app .
55
 
56
+ # Expose port for Hugging Face Space
57
  EXPOSE 7860
58
 
59
+ # Launch app using Uvicorn
60
+ CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]