mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
refactor: cleanup code
This commit is contained in:
33
docker/base-image/install/python/python.sh
Normal file
33
docker/base-image/install/python/python.sh
Normal file
@@ -0,0 +1,33 @@
|
||||
#!/bin/bash
|
||||
|
||||
# install python
|
||||
apt-get update \
|
||||
&& apt install software-properties-common -y \
|
||||
&& add-apt-repository ppa:deadsnakes/ppa -y \
|
||||
&& apt install python3.10 -y \
|
||||
&& curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10
|
||||
|
||||
# alias
|
||||
rm /usr/local/bin/pip | true
|
||||
rm /usr/local/bin/python | true
|
||||
ln -s /usr/local/bin/pip3.10 /usr/local/bin/pip
|
||||
ln -s /usr/bin/python3.10 /usr/local/bin/python
|
||||
|
||||
# verify
|
||||
python_version=$(python -V)
|
||||
if [[ $python_version =~ "Python 3.10" ]]; then
|
||||
:
|
||||
else
|
||||
echo "ERROR: python version does not match. expect \"Python 3.10\", but actual is \"${python_version}\""
|
||||
exit 1
|
||||
fi
|
||||
pip_version=$(pip -V)
|
||||
if [[ $pip_version =~ "python 3.10" ]]; then
|
||||
:
|
||||
else
|
||||
echo "ERROR: pip version does not match. expected: \"python 3.10\", but actual is \"${pip_version}\""
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# install python dependencies
|
||||
pip install -r /app/install/python/requirements.txt
|
||||
9
docker/base-image/install/python/requirements.txt
Normal file
9
docker/base-image/install/python/requirements.txt
Normal file
@@ -0,0 +1,9 @@
|
||||
scrapy>=2.9.0
|
||||
pymongo
|
||||
bs4
|
||||
crawlab-sdk>=0.6.0
|
||||
crawlab-demo<=0.1.0
|
||||
selenium
|
||||
pyopenssl
|
||||
playwright
|
||||
feapder
|
||||
Reference in New Issue
Block a user