Gayatri kancharla commited on
Commit
cb6694b
·
verified ·
1 Parent(s): cedd8d8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -12
Dockerfile CHANGED
@@ -1,22 +1,31 @@
 
1
  FROM python:3.10-slim
2
 
3
- # Install system dependencies for librosa and transformers
 
 
 
 
 
 
 
 
4
  RUN apt-get update && apt-get install -y \
5
  libsndfile1 \
6
- gcc \
7
  && rm -rf /var/lib/apt/lists/*
8
 
9
- WORKDIR /app
 
10
 
11
- # Upgrade pip to ensure compatibility
12
- RUN pip install --no-cache-dir --upgrade pip
13
 
14
- # Copy and install requirements
15
- COPY requirements.txt .
16
- RUN pip install --no-cache-dir -r requirements.txt
17
 
18
- # Copy application files
19
- COPY . .
 
20
 
21
- # Run the application
22
- CMD ["python", "app.py"]
 
1
+ # Use official Python 3.10 slim image as base for smaller footprint
2
  FROM python:3.10-slim
3
 
4
+ # Set working directory inside the container
5
+ WORKDIR /app
6
+
7
+ # Copy application files
8
+ COPY app.py .
9
+ COPY requirements.txt .
10
+ COPY templates/index.html templates/index.html
11
+
12
+ # Install system dependencies required for librosa and soundfile
13
  RUN apt-get update && apt-get install -y \
14
  libsndfile1 \
 
15
  && rm -rf /var/lib/apt/lists/*
16
 
17
+ # Install Python dependencies from requirements.txt
18
+ RUN pip install --no-cache-dir -r requirements.txt
19
 
20
+ # Create directories for uploads and static files
21
+ RUN mkdir -p uploads static
22
 
23
+ # Expose port 5000 for Flask app
24
+ EXPOSE 5000
 
25
 
26
+ # Set environment variables for Flask
27
+ ENV FLASK_APP=app.py
28
+ ENV FLASK_ENV=production
29
 
30
+ # Command to run the Flask application
31
+ CMD ["flask", "run", "--host=0.0.0.0", "--port=5000"]