modify scripts
This commit is contained in:
@ -1,11 +1,10 @@
|
|||||||
# 选择基础镜像,使用 Ubuntu 最新版本
|
# 选择基础镜像,使用 Ubuntu 最新版本
|
||||||
#FROM ubuntu:latest
|
|
||||||
FROM --platform=linux/amd64 ubuntu:latest
|
FROM --platform=linux/amd64 ubuntu:latest
|
||||||
|
|
||||||
# 设置时区,避免交互式输入
|
# 设置时区,避免交互式输入
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
# 安装基础工具和 Golang
|
# 安装基础工具和 开发工具包 build-essential
|
||||||
RUN apt-get update && apt-get install -y \
|
RUN apt-get update && apt-get install -y \
|
||||||
curl wget git vim build-essential \
|
curl wget git vim build-essential \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|||||||
@ -1,18 +1,22 @@
|
|||||||
# 使用 Ubuntu 最新的 x86_64 版本
|
# 使用 Ubuntu 最新的 x86_64 版本
|
||||||
FROM --platform=linux/amd64 ubuntu:latest
|
FROM --platform=linux/amd64 ubuntu:latest
|
||||||
|
|
||||||
# 设置时区环境变量
|
# 设置时区,避免交互式输入
|
||||||
ENV TZ=Asia/Shanghai
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
RUN apt update && apt install -y tzdata && ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
|
||||||
|
|
||||||
# 安装必要的系统包
|
# 安装必要的系统包,和python环境
|
||||||
RUN apt update && \
|
RUN apt-get update && apt-get install -y \
|
||||||
apt install -y python3 python3-pip git wget curl unzip nano && \
|
curl wget git vim unzip nano python3 python3-pip \
|
||||||
apt clean && rm -rf /var/lib/apt/lists/*
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
# 设置 Python 环境
|
# 创建工作目录
|
||||||
# RUN pip install --upgrade pip --break-system-packages && \
|
WORKDIR /app
|
||||||
RUN pip install --upgrade cloudscraper requests BeautifulSoup4 lxml pymysql futu-api cryptography --break-system-packages
|
|
||||||
|
# 将 requirements.txt 复制到工作目录
|
||||||
|
COPY requirements.txt .
|
||||||
|
|
||||||
|
# 安装项目依赖
|
||||||
|
RUN pip3 install -r requirements.txt --break-system-packages
|
||||||
|
|
||||||
# 设置 Git 配置
|
# 设置 Git 配置
|
||||||
RUN git config --global user.name "oscar" && \
|
RUN git config --global user.name "oscar" && \
|
||||||
|
|||||||
11
stock/requirements.txt
Normal file
11
stock/requirements.txt
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# 绕过cloudflare限制的包
|
||||||
|
cloudscraper
|
||||||
|
|
||||||
|
requests
|
||||||
|
beautifulsoup4
|
||||||
|
lxml
|
||||||
|
pymysql
|
||||||
|
|
||||||
|
# futu openapi 包,以及它依赖的加密库
|
||||||
|
futu-api
|
||||||
|
cryptography
|
||||||
Reference in New Issue
Block a user