chore: Update Dockerfile and install_panel.sh for Python environment setup
This commit is contained in:
parent
fa843d4333
commit
e39e9e91f8
@ -1,8 +1,8 @@
|
||||
FROM alpine
|
||||
FROM python:3.7.16-alpine
|
||||
|
||||
# 切换 alpine 镜像源为腾讯云源,更新包列表并安装依赖
|
||||
RUN apk update && apk upgrade \
|
||||
&& apk add curl curl-dev libffi-dev openssl-dev shadow bash zlib-dev g++ make sqlite-dev libpcap-dev jpeg-dev dos2unix libev-dev build-base linux-headers python3 python3-dev py3-pip \
|
||||
&& apk add curl curl-dev libffi-dev openssl-dev shadow bash zlib-dev g++ make sqlite-dev libpcap-dev jpeg-dev dos2unix libev-dev build-base linux-headers \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
|
||||
# 复制脚本
|
||||
|
@ -848,19 +848,8 @@ Install_Python_Lib(){
|
||||
fi
|
||||
|
||||
# 针对 Alpine Linux 系统的安装方式
|
||||
is_alpine=$(cat /etc/os-release | grep -i alpine)
|
||||
is_alpine=$(cat /etc/os-release | grep -i alpine)
|
||||
if [ "$is_alpine" != "" ];then
|
||||
apk update
|
||||
apk add build-base wget zlib-dev bzip2-dev openssl-dev ncurses-dev libffi-dev xz-dev
|
||||
|
||||
# 下载并编译 Python 3.7.16
|
||||
cd /usr/src
|
||||
wget https://www.python.org/ftp/python/3.7.16/Python-3.7.16.tar.xz
|
||||
tar xf Python-3.7.16.tar.xz
|
||||
cd Python-3.7.16
|
||||
./configure --enable-optimizations
|
||||
make altinstall
|
||||
|
||||
# 创建虚拟环境
|
||||
python3.7 -m venv $pyenv_path/pyenv
|
||||
source $pyenv_path/pyenv/bin/activate
|
||||
@ -1500,5 +1489,3 @@ fi
|
||||
if [ "${INSTALL_DATE}" ];then
|
||||
curl -sS --connect-timeout 3 -m 3 --request POST --url "https://www.bt.cn/Api/installationCount" --data "date=${INSTALL_DATE}" --data "status=1" --data "ip=${getIpAddress}" > /dev/null
|
||||
fi
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user