scrape-with-ai / dockerfile
PyQuarX's picture
Create dockerfile
700a635 verified
raw
history blame
1.49 kB
# Utilise une image de base Python officielle
FROM python:3.10-slim
# Installation des dépendances
RUN apt-get update && \
apt-get install -y wget unzip curl gnupg ca-certificates fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 \
libatk1.0-0 libcups2 libdbus-1-3 libgdk-pixbuf2.0-0 libnspr4 libnss3 libx11-xcb1 libxcomposite1 libxdamage1 libxrandr2 xdg-utils && \
rm -rf /var/lib/apt/lists/*
# Installation de Chromium
RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
apt-get update && \
apt-get install -y ./google-chrome-stable_current_amd64.deb && \
rm google-chrome-stable_current_amd64.deb
# Installation de chromedriver (version compatible avec Chrome)
RUN CHROME_VERSION=$(google-chrome --version | cut -d " " -f 3 | cut -d "." -f 1) && \
DRIVER_VERSION=$(curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_VERSION") && \
wget -q "https://chromedriver.storage.googleapis.com/${DRIVER_VERSION}/chromedriver_linux64.zip" && \
unzip chromedriver_linux64.zip && \
mv chromedriver /usr/bin/chromedriver && \
chmod +x /usr/bin/chromedriver && \
rm chromedriver_linux64.zip
# Création du dossier d'app
WORKDIR /app
# Copie des fichiers
COPY . .
# Installation des dépendances Python
RUN pip install --no-cache-dir -r requirements.txt
# Lancement de l'app Streamlit
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]