priaansh commited on
Commit
564d0db
·
verified ·
1 Parent(s): d201a58

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -15
Dockerfile CHANGED
@@ -1,26 +1,28 @@
1
- # Use the official Python image as the base
2
  FROM python:3.9-slim
3
 
4
- # Set the working directory
 
 
 
 
5
  WORKDIR /app
6
 
7
- # Install dependencies
 
 
 
 
 
8
  COPY requirements.txt .
 
9
  RUN pip install --no-cache-dir -r requirements.txt
10
 
11
- # Copy the application code
12
  COPY . .
13
 
14
- # Expose the application port
15
  EXPOSE 8080
16
 
17
- # Define environment variables (these can be overridden in HF Spaces settings)
18
- ENV API_KEY=default_api_key \
19
- S3_ENDPOINT_URL=https://s3.amazonaws.com \
20
- S3_ACCESS_KEY=default_access_key \
21
- S3_SECRET_KEY=default_secret_key \
22
- S3_BUCKET_NAME=default_bucket \
23
- S3_REGION=us-east-1
24
-
25
- # Start the Flask application
26
- CMD ["python", "app.py"]
 
1
+ # Use the official Python image as base
2
  FROM python:3.9-slim
3
 
4
+ # Set environment variables
5
+ ENV PYTHONDONTWRITEBYTECODE=1
6
+ ENV PYTHONUNBUFFERED=1
7
+
8
+ # Set work directory
9
  WORKDIR /app
10
 
11
+ # Install system dependencies
12
+ RUN apt-get update && apt-get install -y \
13
+ ffmpeg \
14
+ && rm -rf /var/lib/apt/lists/*
15
+
16
+ # Install Python dependencies
17
  COPY requirements.txt .
18
+ RUN pip install --upgrade pip
19
  RUN pip install --no-cache-dir -r requirements.txt
20
 
21
+ # Copy project
22
  COPY . .
23
 
24
+ # Expose the port
25
  EXPOSE 8080
26
 
27
+ # Run the application
28
+ CMD ["python", "app.py"]