nakas commited on
Commit
6db5220
·
verified ·
1 Parent(s): 26edd7d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +11 -15
Dockerfile CHANGED
@@ -1,25 +1,21 @@
1
- # Use an official Python runtime as a parent image
2
  FROM python:3.9-slim
3
 
4
- # Install apt dependencies for Chromium
5
  RUN apt-get update && apt-get install -y \
6
- chromium-browser \
7
- chromium-chromedriver \
8
  && rm -rf /var/lib/apt/lists/*
9
 
10
- # Set environment variables so Selenium can find Chromium
11
- ENV CHROME_BIN=/usr/bin/chromium-browser
12
- ENV CHROMEDRIVER_PATH=/usr/bin/chromedriver
13
 
14
- # Copy the requirements file and install Python dependencies
15
  COPY requirements.txt .
16
- RUN pip install --upgrade pip && pip install -r requirements.txt
17
 
18
- # Copy the rest of the application code
19
- COPY app.py .
 
20
 
21
- # Expose port 7860 (the default for Gradio)
22
- EXPOSE 7860
23
-
24
- # Run the application
25
  CMD ["python", "app.py"]
 
 
1
  FROM python:3.9-slim
2
 
3
+ # Install system dependencies
4
  RUN apt-get update && apt-get install -y \
5
+ chromium \
6
+ chromium-driver \
7
  && rm -rf /var/lib/apt/lists/*
8
 
9
+ # Set environment variables for Chromium
10
+ ENV PATH="/usr/lib/chromium/:$PATH"
 
11
 
12
+ # Install Python dependencies
13
  COPY requirements.txt .
14
+ RUN pip install --no-cache-dir -r requirements.txt
15
 
16
+ # Copy application files
17
+ COPY . /app
18
+ WORKDIR /app
19
 
20
+ # Run application
 
 
 
21
  CMD ["python", "app.py"]