-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed
pip install -e .
+ can be installed locally again
- Loading branch information
1 parent
ee47bd1
commit a26f58b
Showing
9 changed files
with
156 additions
and
143 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,63 @@ | ||
FROM python:3.10 as base | ||
|
||
|
||
FROM base as builder-chromedriver | ||
|
||
ENV PYTHONDONTWRITEBYTECODE=1 | ||
ENV PYTHONUNBUFFERED=1 | ||
|
||
# install all packages for chromedriver: https://gist.github.com/varyonic/dea40abcf3dd891d204ef235c6e8dd79 | ||
RUN apt-get update && \ | ||
apt-get install -y xvfb gnupg wget curl unzip --no-install-recommends && \ | ||
RUN set -ex && \ | ||
apt-get update && \ | ||
apt-get install -y \ | ||
xvfb \ | ||
gnupg \ | ||
wget \ | ||
curl \ | ||
unzip \ | ||
cron \ | ||
vim \ | ||
fish \ | ||
python3-dev \ | ||
bat \ | ||
--no-install-recommends && \ | ||
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \ | ||
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list && \ | ||
apt-get update -y | ||
|
||
RUN apt-get install -y google-chrome-stable && \ | ||
CHROMEVER=$(google-chrome --product-version | grep -o "[^\.]*\.[^\.]*\.[^\.]*") && \ | ||
DRIVERVER=$(curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROMEVER") | ||
|
||
RUN wget -q --continue -P /chromedriver "http://chromedriver.storage.googleapis.com/$DRIVERVER/chromedriver_linux64.zip" && \ | ||
unzip /chromedriver/chromedriver* -d /chromedriver | ||
|
||
# make the chromedriver executable and move it to default selenium path. | ||
RUN chmod +x /chromedriver/chromedriver | ||
RUN mv /chromedriver/chromedriver /usr/bin/chromedriver | ||
RUN set -ex && \ | ||
apt-get install -y google-chrome-stable && \ | ||
export CHROMEVER=$(google-chrome --product-version | grep -o "[^\.]*\.[^\.]*\.[^\.]*") && \ | ||
export DRIVERVER=$(curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROMEVER") | ||
|
||
#RUN set -ex && \ | ||
# echo "Using chromedriver version: $DRIVERVER" | ||
# | ||
#RUN set -ex && \ | ||
# wget -q --continue -P /chromedriver "http://chromedriver.storage.googleapis.com/$DRIVERVER/chromedriver_linux64.zip" && \ | ||
# unzip /chromedriver/chromedriver* -d /chromedriver | ||
# | ||
## make the chromedriver executable and move it to default selenium path. | ||
#RUN set -ex && \ | ||
# chmod +x /chromedriver/chromedriver | ||
# | ||
#RUN set -ex && \ | ||
# mv /chromedriver/chromedriver /usr/bin/chromedriver | ||
|
||
#RUN curl -LO https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | ||
#RUN apt-get install -y ./google-chrome-stable_current_amd64.deb | ||
#RUN rm google-chrome-stable_current_amd64.deb | ||
|
||
FROM builder-chromedriver as builder-python | ||
|
||
COPY requirements.txt /app/requirements.txt | ||
|
||
RUN set -ex && \ | ||
apt-get update && \ | ||
apt-get -y install \ | ||
cron \ | ||
vim \ | ||
fish \ | ||
python3-dev \ | ||
bat \ | ||
--no-install-recommends && \ | ||
pip install --upgrade pip && \ | ||
pip install --no-cache-dir -r /app/requirements.txt && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
service cron start | ||
RUN pip install -e . | ||
pip install -r /app/requirements.txt | ||
|
||
FROM builder-python | ||
#RUN set -ex && \ | ||
# pip install -e . | ||
|
||
# set the proxy addresses | ||
ENV HTTP_PROXY "http://134.209.29.120:8080" | ||
ENV HTTPS_PROXY "https://45.77.71.140:9050" | ||
#ENV HTTP_PROXY "http://134.209.29.120:8080" | ||
#ENV HTTPS_PROXY "https://45.77.71.140:9050" | ||
|
||
WORKDIR /app | ||
CMD ["fish"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,99 +1,43 @@ | ||
# Use the official Selenium Grid Base image as the base image | ||
FROM selenium/standalone-chrome:119.0 as base | ||
#FROM UBUNTU:20.04 as base | ||
FROM selenium/standalone-chrome:latest | ||
|
||
# Set the desired Chrome and ChromeDriver versions | ||
ENV CHROME_VERSION 119.0 | ||
ENV CHROMEDRIVER_VERSION 119.0 | ||
ENV SELENIUM_VERSION 4.9.0 | ||
# install google chrome | ||
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - | ||
RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' | ||
RUN apt-get -y update | ||
RUN apt-get install -y google-chrome-stable | ||
|
||
# Install Chrome and ChromeDriver with the specified versions | ||
#RUN wget -q -O /tmp/chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \ | ||
# dpkg -i /tmp/chrome.deb || apt-get -f install -y && \ | ||
# rm /tmp/chrome.deb | ||
#RUN wget -q -O /tmp/chromedriver.zip https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip && \ | ||
# unzip /tmp/chromedriver.zip -d /usr/bin && \ | ||
# chmod +x /usr/bin/chromedriver && \ | ||
# rm /tmp/chromedriver.zip | ||
# Set the desired Chrome and ChromeDriver versions as environment variables | ||
#ENV CHROME_VERSION 119.0 | ||
#ENV CHROMEDRIVER_VERSION 119.0 | ||
# install chromedriver | ||
RUN apt-get install -yqq unzip | ||
RUN wget -O /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`/chromedriver_linux64.zip | ||
RUN unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/ | ||
|
||
FROM base as chromedriver | ||
# set display port to avoid crash | ||
ENV DISPLAY=:99 | ||
|
||
# Install Chrome | ||
RUN wget -q -O /tmp/chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb && \ | ||
dpkg -i /tmp/chrome.deb || apt-get -f install -y && \ | ||
rm /tmp/chrome.deb | ||
# install selenium | ||
RUN pip install selenium==3.8.0 | ||
|
||
# Install ChromeDriver | ||
RUN wget -q -O /tmp/chromedriver.zip https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip && \ | ||
unzip /tmp/chromedriver.zip -d /usr/bin && \ | ||
chmod +x /usr/bin/chromedriver && \ | ||
rm /tmp/chromedriver.zip | ||
|
||
RUN set -ex && \ | ||
apt-get update && \ | ||
apt-get install -y \ | ||
python3-dev \ | ||
--no-install-recommends | ||
|
||
# wget \ | ||
# curl \ | ||
# unzip \ | ||
# cron \ | ||
# vim \ | ||
# fish \ | ||
# bat \ | ||
# xvfb \ | ||
# gnupg \ | ||
# rm -rf /var/lib/apt/lists/* | ||
|
||
#RUN apt-get install -y google-chrome-stable && \ | ||
|
||
#RUN apt-get update && \ | ||
# apt-get install -y xvfb gnupg wget curl unzip --no-install-recommends && \ | ||
# wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \ | ||
# echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list && \ | ||
# apt-get update -y | ||
# | ||
#RUN apt-get install -y google-chrome-stable && \ | ||
# CHROMEVER=$(google-chrome --product-version | grep -o "[^\.]*\.[^\.]*\.[^\.]*") && \ | ||
# DRIVERVER=$(curl -s "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_$CHROMEVER") | ||
# | ||
#RUN wget -q --continue -P /chromedriver "http://chromedriver.storage.googleapis.com/$DRIVERVER/chromedriver_linux64.zip" && \ | ||
# unzip /chromedriver/chromedriver* -d /chromedriver | ||
|
||
## install google chrome | ||
#RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - | ||
#RUN sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' | ||
#RUN apt-get -y update | ||
#RUN apt-get install -y google-chrome-stable | ||
# | ||
## install chromedriver | ||
#RUN apt-get install -yqq unzip | ||
#RUN wget -O /tmp/chromedriver.zip http://chromedriver.storage.googleapis.com/`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`/chromedriver_linux64.zip | ||
#RUN unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/ | ||
# | ||
## set display port to avoid crash | ||
#ENV DISPLAY=:99 | ||
# | ||
## install selenium | ||
#RUN pip install selenium==3.8.0 | ||
|
||
# Set the Chrome and ChromeDriver versions as environment variables | ||
#ENV CHROME_DRIVER_VERSION $CHROMEDRIVER_VERSION | ||
#ENV CHROME_BROWSER_VERSION $CHROME_VERSION | ||
|
||
# Expose the default Selenium Grid port | ||
#EXPOSE 4444 | ||
|
||
# Start the Selenium Grid server | ||
#CMD ["start-selenium-grid.sh"] | ||
|
||
FROM chromedriver as project | ||
RUN set -ex && \ | ||
apt-get update && \ | ||
apt-get -y install \ | ||
cron \ | ||
vim \ | ||
fish \ | ||
python3-dev \ | ||
bat \ | ||
--no-install-recommends && \ | ||
pip install --upgrade pip && \ | ||
pip install --no-cache-dir -r /app/requirements.txt && \ | ||
rm -rf /var/lib/apt/lists/* && \ | ||
service cron start | ||
RUN pip install -e . | ||
pip install --no-cache-dir -r /app/requirements.txt | ||
|
||
FROM project | ||
# set the proxy addresses | ||
#ENV HTTP_PROXY "http://134.209.29.120:8080" | ||
#ENV HTTPS_PROXY "https://45.77.71.140:9050" | ||
|
||
CMD ["fish"] | ||
RUN pip install -e . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,44 @@ | ||
## Build | ||
#[build-system] | ||
#requires = ["setuptools"] | ||
#build-backend = "setuptools.build_meta" | ||
# | ||
#[project] | ||
#authors = [ | ||
# {name = "Zdenek Lapes", email = "[email protected]"} | ||
#] | ||
#name = "bazos" | ||
#version = "0.1.0" | ||
#description = "Bazos api (scraping) for python" | ||
#readme = "README.md" | ||
#keywords = [ | ||
# "bazos", | ||
# "api", | ||
# "scraping", | ||
# "python", | ||
# "bazos.cz", | ||
# "bazos.sk", | ||
# "bazos.at", | ||
# "bazos.pl", | ||
#] | ||
#license = { file = "LICENSE" } | ||
#requires-python = ">=3.10" | ||
#dynamic = [ | ||
# "dependencies", | ||
#] | ||
# | ||
## TODO: Fix exeting the bazos command on cli | ||
#[tool.setuptools.packages.find] | ||
#where = ["."] | ||
#include = ["bazos.*"] | ||
#namespaces = false | ||
# | ||
#[tool.setuptools.dynamic] | ||
#dependencies = { file = ["requirements.txt"] } | ||
# | ||
#[project.scripts] | ||
#bazos = "bazos.__init__:main" | ||
|
||
[tool.ruff] | ||
line-length = 120 | ||
select = ["E", "F"] # Enable Pyflakes `E` and `F` codes by default. | ||
|
Oops, something went wrong.