Spaces:
Runtime error
Runtime error
Create dockerfile
Browse files- dockerfile +25 -0
dockerfile
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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"]
|