mike23415 commited on
Commit
916aef5
·
verified ·
1 Parent(s): 798ae00

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +9 -5
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- # Use a slimmer official Python image
2
  FROM python:3.9-slim
3
 
4
  # Set working directory
@@ -7,9 +7,13 @@ WORKDIR /app
7
  # Install system dependencies for PyPDF2, python-pptx, etc.
8
  RUN apt-get update && apt-get install -y --no-install-recommends \
9
  gcc \
 
 
 
 
10
  && rm -rf /var/lib/apt/lists/*
11
 
12
- # Copy requirements file and install Python dependencies
13
  COPY requirements.txt .
14
  RUN pip install --no-cache-dir -r requirements.txt
15
 
@@ -23,8 +27,8 @@ RUN python -c "from transformers import T5Tokenizer, T5ForConditionalGeneration;
23
  # Copy the entire application
24
  COPY . .
25
 
26
- # Expose the application port
27
  EXPOSE 7860
28
 
29
- # Run Gunicorn with logging
30
- CMD ["gunicorn", "-w", "2", "-b", "0.0.0.0:7860", "--log-level", "info", "app:app"]
 
1
+ # Use a slim official Python image
2
  FROM python:3.9-slim
3
 
4
  # Set working directory
 
7
  # Install system dependencies for PyPDF2, python-pptx, etc.
8
  RUN apt-get update && apt-get install -y --no-install-recommends \
9
  gcc \
10
+ libjpeg-dev \
11
+ zlib1g-dev \
12
+ libpng-dev \
13
+ libfreetype6-dev \
14
  && rm -rf /var/lib/apt/lists/*
15
 
16
+ # Copy requirements file and install dependencies
17
  COPY requirements.txt .
18
  RUN pip install --no-cache-dir -r requirements.txt
19
 
 
27
  # Copy the entire application
28
  COPY . .
29
 
30
+ # Expose application port
31
  EXPOSE 7860
32
 
33
+ # Run Gunicorn with logging (2 workers for concurrency)
34
+ CMD ["gunicorn", "-w", "2", "-b", "0.0.0.0:7860", "--log-level", "info", "app:app"]