hivecorp commited on
Commit
4c6c53d
·
verified ·
1 Parent(s): 96c37a4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -1
Dockerfile CHANGED
@@ -1,11 +1,23 @@
 
1
  FROM python:3.10-slim
2
 
 
3
  WORKDIR /app
4
 
 
 
 
 
5
  COPY requirements.txt .
6
- RUN apt-get update && apt-get install -y ffmpeg && pip install -r requirements.txt
7
 
 
 
 
 
8
  COPY . .
9
 
 
10
  EXPOSE 7860
 
 
11
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Use a lightweight Python base image
2
  FROM python:3.10-slim
3
 
4
+ # Set the working directory inside the container
5
  WORKDIR /app
6
 
7
+ # Install system dependencies required for MoviePy (FFmpeg)
8
+ RUN apt-get update && apt-get install -y ffmpeg && rm -rf /var/lib/apt/lists/*
9
+
10
+ # Copy requirements first for better caching in Docker layers
11
  COPY requirements.txt .
 
12
 
13
+ # Install Python dependencies
14
+ RUN pip install --no-cache-dir -r requirements.txt
15
+
16
+ # Copy the rest of your app code
17
  COPY . .
18
 
19
+ # Expose port 7860 (required by HuggingSpace)
20
  EXPOSE 7860
21
+
22
+ # Run the FastAPI app using Uvicorn
23
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]