Spaces:
Running
Running
Create dockerfile
Browse files- dockerfile +35 -0
dockerfile
ADDED
@@ -0,0 +1,35 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Utilise une image de base Python officielle
|
2 |
+
FROM python:3.10-slim
|
3 |
+
|
4 |
+
# Installation des dépendances
|
5 |
+
RUN apt-get update && \
|
6 |
+
apt-get install -y wget unzip curl gnupg ca-certificates fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 \
|
7 |
+
libatk1.0-0 libcups2 libdbus-1-3 libgdk-pixbuf2.0-0 libnspr4 libnss3 libx11-xcb1 libxcomposite1 libxdamage1 libxrandr2 xdg-utils && \
|
8 |
+
rm -rf /var/lib/apt/lists/*
|
9 |
+
|
10 |
+
# Installation de Chromium
|
11 |
+
RUN wget -q https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \
|
12 |
+
apt-get update && \
|
13 |
+
apt-get install -y ./google-chrome-stable_current_amd64.deb && \
|
14 |
+
rm google-chrome-stable_current_amd64.deb
|
15 |
+
|
16 |
+
# Installation de chromedriver (version compatible avec Chrome)
|
17 |
+
RUN CHROME_VERSION=$(google-chrome --version | cut -d " " -f 3 | cut -d "." -f 1) && \
|
18 |
+
DRIVER_VERSION=$(curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROME_VERSION") && \
|
19 |
+
wget -q "https://chromedriver.storage.googleapis.com/${DRIVER_VERSION}/chromedriver_linux64.zip" && \
|
20 |
+
unzip chromedriver_linux64.zip && \
|
21 |
+
mv chromedriver /usr/bin/chromedriver && \
|
22 |
+
chmod +x /usr/bin/chromedriver && \
|
23 |
+
rm chromedriver_linux64.zip
|
24 |
+
|
25 |
+
# Création du dossier d'app
|
26 |
+
WORKDIR /app
|
27 |
+
|
28 |
+
# Copie des fichiers
|
29 |
+
COPY . .
|
30 |
+
|
31 |
+
# Installation des dépendances Python
|
32 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
33 |
+
|
34 |
+
# Lancement de l'app Streamlit
|
35 |
+
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]
|