devusman commited on
Commit
f994fea
·
1 Parent(s): 5d10b61
Files changed (1) hide show
  1. Dockerfile +13 -15
Dockerfile CHANGED
@@ -1,30 +1,28 @@
1
- # Dockerfile
 
2
 
3
- # Use an official Python runtime as a parent image
4
- FROM python:3.10-slim-buster
5
 
6
- # 1. Install FFmpeg
7
- # Debian/Ubuntu based images allow easy installation via apt
8
  RUN apt-get update && \
9
- apt-get install -y ffmpeg && \
10
  rm -rf /var/lib/apt/lists/*
11
 
12
- # Set the working directory in the container
13
  WORKDIR /app
14
 
15
- # 2. Copy requirements file and install dependencies
16
  COPY requirements.txt /app/requirements.txt
17
 
18
- # Install Python dependencies, including Gunicorn for production server
19
  RUN pip install --no-cache-dir -r requirements.txt
20
 
21
- # 3. Copy the application code. NOTE: Changed file name to app.py
22
  COPY app.py /app/
23
 
24
- # Port 8080 is the standard port for Hugging Face Spaces Docker deployments
25
  EXPOSE 8080
26
 
27
- # 4. Run the Flask application using Gunicorn
28
- # Binds to 0.0.0.0:8080
29
- # Format: 'module_name:app_variable_name' -> 'app:ffmpeg_app'
30
- CMD exec gunicorn --bind 0.0.0.0:8080 --workers 2 app:ffmpeg_app
 
1
+ # Use an updated, secure Python image
2
+ FROM python:3.10-slim-bullseye
3
 
4
+ # Prevent interactive prompts during package installs
5
+ ENV DEBIAN_FRONTEND=noninteractive
6
 
7
+ # 1. Install FFmpeg and any essential system dependencies
 
8
  RUN apt-get update && \
9
+ apt-get install -y --no-install-recommends ffmpeg && \
10
  rm -rf /var/lib/apt/lists/*
11
 
12
+ # 2. Set working directory
13
  WORKDIR /app
14
 
15
+ # 3. Copy requirements first (better caching)
16
  COPY requirements.txt /app/requirements.txt
17
 
18
+ # 4. Install Python dependencies
19
  RUN pip install --no-cache-dir -r requirements.txt
20
 
21
+ # 5. Copy your Flask application file
22
  COPY app.py /app/
23
 
24
+ # 6. Expose the port
25
  EXPOSE 8080
26
 
27
+ # 7. Command to run your app via Gunicorn
28
+ CMD exec gunicorn --bind 0.0.0.0:8080 --workers 2 app:ffmpeg_app