WebashalarForML commited on
Commit
35e2a0f
·
verified ·
1 Parent(s): 1807fbf

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +19 -9
Dockerfile CHANGED
@@ -1,25 +1,35 @@
1
  FROM python:3.9-slim-bullseye
2
 
 
3
  ENV PYTHONUNBUFFERED=1 \
4
  PORT=7860 \
5
- # Ensuring the llvm-config from clang-11 is used:
6
  LLVM_CONFIG=/usr/bin/llvm-config
7
 
8
  WORKDIR /app
9
 
10
- RUN apt-get update && \
11
- apt-get install -y --no-install-recommends \
12
- ffmpeg git curl \
13
- libgl1-mesa-glx libglib2.0-0 libsm6 libxrender1 libxext6 \
14
- build-essential \
15
- llvm llvm-dev clang-11 \
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
- # Pip setup
19
- RUN pip install --upgrade pip && pip install numpy==1.21.6
 
 
 
20
  COPY requirements.txt .
21
  RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
 
22
  COPY . .
23
 
24
  EXPOSE 7860
 
25
  CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]
 
1
  FROM python:3.9-slim-bullseye
2
 
3
+ # Environment
4
  ENV PYTHONUNBUFFERED=1 \
5
  PORT=7860 \
 
6
  LLVM_CONFIG=/usr/bin/llvm-config
7
 
8
  WORKDIR /app
9
 
10
+ # Install system dependencies + LLVM 11 & build essentials
11
+ RUN apt-get update && apt-get install -y --no-install-recommends \
12
+ ffmpeg git curl \
13
+ libgl1-mesa-glx libglib2.0-0 libsm6 libxrender1 libxext6 \
14
+ build-essential \
15
+ llvm llvm-dev clang-11 \
16
  && rm -rf /var/lib/apt/lists/*
17
 
18
+ # Upgrade pip and install numpy before llvmlite/numba
19
+ RUN pip install --upgrade pip
20
+ RUN pip install numpy==1.21.6
21
+
22
+ # Add gunicorn and app dependencies
23
  COPY requirements.txt .
24
  RUN pip install --no-cache-dir -r requirements.txt
25
+
26
+ # Create necessary directories with appropriate permissions
27
+ 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
28
+ RUN chmod -R 777 /app
29
+
30
+ # Copy application code
31
  COPY . .
32
 
33
  EXPOSE 7860
34
+
35
  CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:app"]