Create Dockerfile
Browse files- Dockerfile +38 -0
Dockerfile
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM ubuntu:20.04
|
| 2 |
+
|
| 3 |
+
# Avoid interactive prompts during package installation
|
| 4 |
+
ENV DEBIAN_FRONTEND=noninteractive
|
| 5 |
+
|
| 6 |
+
# Install Python 3.9, wget, unzip, and Chrome dependencies
|
| 7 |
+
RUN apt-get update && apt-get install -y \
|
| 8 |
+
python3.9 \
|
| 9 |
+
python3.9-distutils \
|
| 10 |
+
wget \
|
| 11 |
+
unzip \
|
| 12 |
+
libxss1 \
|
| 13 |
+
libappindicator1 \
|
| 14 |
+
libindicator7 \
|
| 15 |
+
fonts-liberation \
|
| 16 |
+
libnss3 \
|
| 17 |
+
xdg-utils
|
| 18 |
+
|
| 19 |
+
# Install pip for Python 3.9
|
| 20 |
+
RUN wget https://bootstrap.pypa.io/get-pip.py && python3.9 get-pip.py
|
| 21 |
+
|
| 22 |
+
# Install Google Chrome
|
| 23 |
+
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \
|
| 24 |
+
&& dpkg -i google-chrome-stable_current_amd64.deb || apt-get install -f -y \
|
| 25 |
+
&& rm google-chrome-stable_current_amd64.deb
|
| 26 |
+
|
| 27 |
+
# Set working directory
|
| 28 |
+
WORKDIR /app
|
| 29 |
+
|
| 30 |
+
# Copy and install Python dependencies
|
| 31 |
+
COPY requirements.txt .
|
| 32 |
+
RUN pip3.9 install --no-cache-dir -r requirements.txt chromedriver-autoinstaller
|
| 33 |
+
|
| 34 |
+
# Copy your application code
|
| 35 |
+
COPY app.py .
|
| 36 |
+
|
| 37 |
+
# Run the app with Python 3.9
|
| 38 |
+
CMD ["python3.9", "app.py"]
|