WebashalarForML commited on
Commit
3eda5c9
·
verified ·
1 Parent(s): 5cd75c1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +13 -15
Dockerfile CHANGED
@@ -1,15 +1,14 @@
1
- # Use Python 3.9 base image
2
  FROM python:3.9-slim
3
 
4
- # Set environment variables
5
  ENV PYTHONDONTWRITEBYTECODE=1 \
6
  PYTHONUNBUFFERED=1 \
7
  PORT=7860
8
 
9
- # Set working directory
10
  WORKDIR /app
11
 
12
- # Install system dependencies including ffmpeg
13
  RUN apt-get update && apt-get install -y --no-install-recommends \
14
  ffmpeg \
15
  git \
@@ -19,24 +18,23 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
19
  libsm6 \
20
  libxrender1 \
21
  libxext6 \
 
 
22
  && rm -rf /var/lib/apt/lists/*
23
 
24
- # Copy requirements.txt
25
- COPY requirements.txt .
26
-
27
- # Upgrade pip to avoid version issues and install dependencies
28
  RUN pip install --upgrade pip
29
- RUN pip install --no-cache-dir -r requirements.txt
30
 
31
- # Create necessary directories with appropriate permissions
32
- RUN mkdir -p /app/cache /app/uploads /app/results /app/checkpoints /app/temp && chmod -R 777 /app/cache /app/uploads /app/results /app/checkpoints /app/temp
33
- RUN chmod -R 777 /app
34
 
35
- # Copy app files
36
  COPY . .
37
 
38
- # Expose port for Hugging Face
39
  EXPOSE 7860
40
 
41
- # Start the Flask app with Gunicorn
42
  CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
 
 
1
  FROM python:3.9-slim
2
 
3
+ # Environment configuration
4
  ENV PYTHONDONTWRITEBYTECODE=1 \
5
  PYTHONUNBUFFERED=1 \
6
  PORT=7860
7
 
8
+ # Working directory
9
  WORKDIR /app
10
 
11
+ # Install system dependencies
12
  RUN apt-get update && apt-get install -y --no-install-recommends \
13
  ffmpeg \
14
  git \
 
18
  libsm6 \
19
  libxrender1 \
20
  libxext6 \
21
+ llvm \
22
+ build-essential \
23
  && rm -rf /var/lib/apt/lists/*
24
 
25
+ # Pre-install numpy to resolve numba setup dependency
 
 
 
26
  RUN pip install --upgrade pip
27
+ RUN pip install numpy==1.21.6
28
 
29
+ # Copy requirements and install remaining dependencies
30
+ COPY requirements.txt .
31
+ RUN pip install --no-cache-dir -r requirements.txt
32
 
33
+ # Copy all application files
34
  COPY . .
35
 
36
+ # Expose Hugging Face Gradio/Flask port
37
  EXPOSE 7860
38
 
39
+ # Launch app with Gunicorn
40
  CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]