rajendrakumarv tejovk311 commited on
Commit
4e02d78
·
verified ·
1 Parent(s): c224e46

Update Dockerfile (#8)

Browse files

- Update Dockerfile (4d215f91f18957afe790d7bd8d83b3080ddbe8a1)


Co-authored-by: Kattamuri Tejo Vardhan <tejovk311@users.noreply.huggingface.co>

Files changed (1) hide show
  1. Dockerfile +14 -18
Dockerfile CHANGED
@@ -1,35 +1,31 @@
1
  FROM python:3.9-slim
2
 
3
- # Install system dependencies for video processing
4
  RUN apt-get update && apt-get install -y \
5
- ffmpeg \
6
- libsm6 \
7
- libxext6 \
8
- libxrender-dev \
9
- libgl1-mesa-glx \
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
- # Set working directory
13
  WORKDIR /app
14
 
15
- # Copy requirements file
16
  COPY requirements.txt .
17
-
18
- # Install Python dependencies
19
  RUN pip install --no-cache-dir -r requirements.txt
20
 
21
  # Copy application code
22
  COPY app.py .
23
 
24
- # Create a directory for temporary files
25
- RUN mkdir -p /tmp/video_processing && chmod 777 /tmp/video_processing
26
 
27
- # Set environment variables
28
- ENV PYTHONUNBUFFERED=1
29
- ENV PORT=7860
30
 
31
- # Expose port
32
  EXPOSE 7860
33
 
34
- # Command to run the application
35
- CMD ["python", "app.py"]
 
1
  FROM python:3.9-slim
2
 
3
+ # System dependencies for video processing
4
  RUN apt-get update && apt-get install -y \
5
+ ffmpeg \
6
+ libsm6 \
7
+ libxext6 \
8
+ libxrender-dev \
9
+ libgl1-mesa-glx \
10
  && rm -rf /var/lib/apt/lists/*
11
 
 
12
  WORKDIR /app
13
 
14
+ # Copy and install Python dependencies
15
  COPY requirements.txt .
 
 
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
18
  # Copy application code
19
  COPY app.py .
20
 
21
+ # Create the HF cache volume
22
+ RUN mkdir -p /cache && chmod 777 /cache
23
 
24
+ # Expose port and set runtime env
25
+ ENV PYTHONUNBUFFERED=1 \
26
+ PORT=7860
27
 
 
28
  EXPOSE 7860
29
 
30
+ # Launch
31
+ CMD ["python", "app.py"]