dhruv2842 commited on
Commit
7066759
·
verified ·
1 Parent(s): 25b1441

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +34 -33
Dockerfile CHANGED
@@ -1,33 +1,34 @@
1
- # Use an official slim Python image
2
- FROM python:3.11-slim
3
-
4
- # Environment variables to prevent Python from buffering output and to avoid prompts
5
- ENV PYTHONDONTWRITEBYTECODE=1
6
- ENV PYTHONUNBUFFERED=1
7
-
8
- # Set work directory inside container
9
- WORKDIR /app
10
-
11
- # Install system dependencies needed by audio libraries and ML packages
12
- RUN apt-get update && apt-get install -y --no-install-recommends \
13
- build-essential \
14
- git \
15
- ffmpeg \
16
- libsndfile1 \
17
- && rm -rf /var/lib/apt/lists/*
18
-
19
- # Copy requirements.txt (must be in the same directory as this Dockerfile)
20
- COPY requirements.txt .
21
-
22
- # Upgrade pip and install Python dependencies
23
- RUN pip install --upgrade pip setuptools wheel
24
- RUN pip install --no-cache-dir -r requirements.txt
25
-
26
- # Copy all backend files (current directory) into the container
27
- COPY . .
28
-
29
- # Expose port (Hugging Face Spaces expects 8080 for Docker apps)
30
- EXPOSE 8080
31
-
32
- # Start the Flask backend using Gunicorn on port 8080
33
- CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:8080", "--workers", "1"]
 
 
1
+ # Use an official slim Python image
2
+ FROM python:3.11-slim
3
+
4
+ # Environment variables to prevent Python from buffering output and to avoid prompts
5
+ ENV PYTHONDONTWRITEBYTECODE=1
6
+ ENV PYTHONUNBUFFERED=1
7
+
8
+ # Set work directory inside container
9
+ WORKDIR /app
10
+
11
+ # Install system dependencies needed by audio libraries and ML packages
12
+ RUN apt-get update && apt-get install -y --no-install-recommends \
13
+ build-essential \
14
+ git \
15
+ ffmpeg \
16
+ libsndfile1 \
17
+ && rm -rf /var/lib/apt/lists/*
18
+
19
+ # Copy requirements.txt (must be in the same directory as this Dockerfile)
20
+ COPY requirements.txt .
21
+
22
+ # Upgrade pip and install Python dependencies
23
+ RUN pip install --upgrade pip setuptools wheel
24
+ RUN pip install --no-cache-dir -r requirements.txt
25
+
26
+ # Copy all backend files (current directory) into the container
27
+ COPY . .
28
+
29
+ # Expose port (Hugging Face Spaces expects 8080 for Docker apps)
30
+ EXPOSE 8080
31
+
32
+ # Start the Flask backend using Gunicorn on port 8080
33
+ CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:8080", "--workers", "1", "--timeout", "300", "--log-level", "info", "--log-file", "-"]
34
+