Create Dockerfile

#1
by saadpie - opened
Files changed (1) hide show
  1. Dockerfile +33 -0
Dockerfile ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use a slim Python image for a smaller footprint
2
+ FROM python:3.11-slim
3
+
4
+ # Set the working directory in the container
5
+ WORKDIR /app
6
+
7
+ # Install system dependencies
8
+ # We include ffmpeg just in case you want to expand audio processing later
9
+ RUN apt-get update && apt-get install -y \
10
+ build-essential \
11
+ ffmpeg \
12
+ && rm -rf /var/lib/apt/lists/*
13
+
14
+ # Copy the requirements file first to leverage Docker cache
15
+ COPY requirements.txt .
16
+
17
+ # Install Python dependencies
18
+ RUN pip install --no-cache-dir -r requirements.txt
19
+
20
+ # Copy the rest of the application code
21
+ COPY . .
22
+
23
+ # Set environment variables
24
+ # HF Spaces uses 7860 by default
25
+ ENV PORT=7860
26
+ ENV PYTHONUNBUFFERED=1
27
+
28
+ # Expose the port
29
+ EXPOSE 7860
30
+
31
+ # Command to run the Quart application
32
+ # We use '0.0.0.0' so it's accessible externally within the container network
33
+ CMD ["python", "app.py"]