mike23415 commited on
Commit
83be853
·
verified ·
1 Parent(s): 41578f8

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -17
Dockerfile CHANGED
@@ -1,29 +1,18 @@
1
- # Use a lightweight Python image
2
- FROM python:3.9-slim
3
 
4
- # Set the working directory inside the container
5
  WORKDIR /app
6
 
7
  # Copy requirements file and install dependencies
8
  COPY requirements.txt .
9
  RUN pip install --no-cache-dir -r requirements.txt
10
 
11
- # Ensure necessary libraries for Hugging Face and document processing
12
- RUN apt-get update && apt-get install -y \
13
- libgl1-mesa-glx \
14
- libglib2.0-0 \
15
- && rm -rf /var/lib/apt/lists/*
16
-
17
- # Copy application files
18
  COPY . .
19
 
20
- # Expose the port Flask runs on
21
  EXPOSE 7860
22
 
23
- # Set environment variables for better CPU performance
24
- ENV TOKENIZERS_PARALLELISM=false \
25
- TRANSFORMERS_OFFLINE=1 \
26
- HF_DATASETS_OFFLINE=1
27
-
28
- # Run the application using Gunicorn with multiple workers
29
  CMD ["gunicorn", "-w", "2", "-b", "0.0.0.0:7860", "app:app"]
 
1
+ # Use official Python image
2
+ FROM python:3.9
3
 
4
+ # Set working directory
5
  WORKDIR /app
6
 
7
  # Copy requirements file and install dependencies
8
  COPY requirements.txt .
9
  RUN pip install --no-cache-dir -r requirements.txt
10
 
11
+ # Copy the entire application
 
 
 
 
 
 
12
  COPY . .
13
 
14
+ # Expose the application port
15
  EXPOSE 7860
16
 
17
+ # Command to run the application
 
 
 
 
 
18
  CMD ["gunicorn", "-w", "2", "-b", "0.0.0.0:7860", "app:app"]