quantumbit commited on
Commit
c4e99e5
·
verified ·
1 Parent(s): 5d68031

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -10
Dockerfile CHANGED
@@ -1,26 +1,27 @@
1
- # Base image
2
  FROM python:3.10-slim
3
 
4
- # Install dependencies for Chrome + Selenium
5
  RUN apt-get update && apt-get install -y \
6
  wget gnupg unzip curl \
7
  chromium chromium-driver \
 
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
- # Set env vars so Selenium finds Chrome
11
  ENV CHROME_BIN=/usr/bin/chromium
12
  ENV CHROMEDRIVER=/usr/bin/chromedriver
13
 
14
- # Install Python deps
15
- COPY requirements.txt requirements.txt
 
16
  RUN pip install --no-cache-dir -r requirements.txt
17
 
18
- # Copy app
19
  COPY app.py /app/app.py
20
- WORKDIR /app
21
 
22
- # Expose port (HF expects 7860)
23
  EXPOSE 7860
24
 
25
- # Run Flask
26
- CMD ["python", "app.py"]
 
1
+ # Use slim Python image
2
  FROM python:3.10-slim
3
 
4
+ # Install system dependencies (Chrome + driver + fonts)
5
  RUN apt-get update && apt-get install -y \
6
  wget gnupg unzip curl \
7
  chromium chromium-driver \
8
+ fonts-liberation \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
+ # Environment variables for Selenium
12
  ENV CHROME_BIN=/usr/bin/chromium
13
  ENV CHROMEDRIVER=/usr/bin/chromedriver
14
 
15
+ # Copy requirements and install
16
+ COPY requirements.txt /app/requirements.txt
17
+ WORKDIR /app
18
  RUN pip install --no-cache-dir -r requirements.txt
19
 
20
+ # Copy app code
21
  COPY app.py /app/app.py
 
22
 
23
+ # Expose port for Hugging Face (7860)
24
  EXPOSE 7860
25
 
26
+ # Start the app with Gunicorn
27
+ CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"]