hivecorp commited on
Commit
ac5220b
·
verified ·
1 Parent(s): d251e99

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +10 -3
Dockerfile CHANGED
@@ -1,8 +1,10 @@
 
1
  FROM python:3.10-slim
2
 
 
3
  WORKDIR /app
4
 
5
- # Install dependencies required by moviepy
6
  RUN apt-get update && apt-get install -y \
7
  ffmpeg \
8
  libsm6 \
@@ -10,13 +12,18 @@ RUN apt-get update && apt-get install -y \
10
  fonts-dejavu-core \
11
  && rm -rf /var/lib/apt/lists/*
12
 
 
13
  COPY requirements.txt .
14
 
15
- # Install all Python requirements
16
- RUN pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir -r requirements.txt
 
17
 
 
18
  COPY . .
19
 
 
20
  EXPOSE 7860
21
 
 
22
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
1
+ # Use slim Python 3.10 base image
2
  FROM python:3.10-slim
3
 
4
+ # Set working directory
5
  WORKDIR /app
6
 
7
+ # Install ffmpeg and required system dependencies
8
  RUN apt-get update && apt-get install -y \
9
  ffmpeg \
10
  libsm6 \
 
12
  fonts-dejavu-core \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
+ # Copy requirements.txt first to leverage Docker cache
16
  COPY requirements.txt .
17
 
18
+ # Install Python dependencies
19
+ RUN pip install --no-cache-dir --upgrade pip \
20
+ && pip install --no-cache-dir -r requirements.txt
21
 
22
+ # Copy your full app into the container
23
  COPY . .
24
 
25
+ # Expose the default port for uvicorn
26
  EXPOSE 7860
27
 
28
+ # Start the FastAPI app with Uvicorn
29
  CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]