Spaces:
Configuration error
Configuration error
Gayatri kancharla
commited on
Update Dockerfile
Browse files- Dockerfile +21 -12
Dockerfile
CHANGED
|
@@ -1,22 +1,31 @@
|
|
|
|
|
| 1 |
FROM python:3.10-slim
|
| 2 |
|
| 3 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
RUN apt-get update && apt-get install -y \
|
| 5 |
libsndfile1 \
|
| 6 |
-
gcc \
|
| 7 |
&& rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
-
|
|
|
|
| 10 |
|
| 11 |
-
#
|
| 12 |
-
RUN
|
| 13 |
|
| 14 |
-
#
|
| 15 |
-
|
| 16 |
-
RUN pip install --no-cache-dir -r requirements.txt
|
| 17 |
|
| 18 |
-
#
|
| 19 |
-
|
|
|
|
| 20 |
|
| 21 |
-
#
|
| 22 |
-
CMD ["
|
|
|
|
| 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"]
|