Spaces:
Runtime error
Runtime error
lucianotonet
commited on
Commit
•
b4da2aa
1
Parent(s):
5a69045
chore: Update Chrome options and ChromeDriver version in app.py and Dockerfile
Browse files- Dockerfile +2 -3
- app.py +2 -1
Dockerfile
CHANGED
@@ -9,7 +9,8 @@ RUN apt-get update && apt-get install -y \
|
|
9 |
&& wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
|
10 |
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' \
|
11 |
&& apt-get update && apt-get install -y \
|
12 |
-
google-chrome-stable
|
|
|
13 |
|
14 |
# Instalar o ChromeDriver
|
15 |
RUN wget -O /tmp/chromedriver.zip https://chromedriver.storage.googleapis.com/`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`/chromedriver_linux64.zip \
|
@@ -34,7 +35,5 @@ COPY --chown=user . /app
|
|
34 |
# Definir o usuário para executar o container
|
35 |
USER user
|
36 |
|
37 |
-
RUN google-chrome --version
|
38 |
-
|
39 |
# Comando para iniciar a aplicação
|
40 |
CMD ["python", "app.py"]
|
|
|
9 |
&& wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
|
10 |
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' \
|
11 |
&& apt-get update && apt-get install -y \
|
12 |
+
google-chrome-stable \
|
13 |
+
&& google-chrome --version
|
14 |
|
15 |
# Instalar o ChromeDriver
|
16 |
RUN wget -O /tmp/chromedriver.zip https://chromedriver.storage.googleapis.com/`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`/chromedriver_linux64.zip \
|
|
|
35 |
# Definir o usuário para executar o container
|
36 |
USER user
|
37 |
|
|
|
|
|
38 |
# Comando para iniciar a aplicação
|
39 |
CMD ["python", "app.py"]
|
app.py
CHANGED
@@ -17,7 +17,7 @@ from dotenv import load_dotenv
|
|
17 |
load_dotenv()
|
18 |
|
19 |
# Inicializar o driver do Selenium com o ChromeDriverManager
|
20 |
-
print("
|
21 |
chromedriver_path = ChromeDriverManager().install()
|
22 |
print("ChromeDriver instalado com sucesso em " + chromedriver_path + "!", end="\n")
|
23 |
|
@@ -148,3 +148,4 @@ try:
|
|
148 |
finally:
|
149 |
print("Driver encerrado com sucesso!")
|
150 |
driver.quit()
|
|
|
|
17 |
load_dotenv()
|
18 |
|
19 |
# Inicializar o driver do Selenium com o ChromeDriverManager
|
20 |
+
print("Verificando a versão do ChromeDriver...", end="\n")
|
21 |
chromedriver_path = ChromeDriverManager().install()
|
22 |
print("ChromeDriver instalado com sucesso em " + chromedriver_path + "!", end="\n")
|
23 |
|
|
|
148 |
finally:
|
149 |
print("Driver encerrado com sucesso!")
|
150 |
driver.quit()
|
151 |
+
|