add config

This commit is contained in:
2025-03-16 16:42:44 +08:00
parent f4f28ca3f4
commit f380ec19d7
2 changed files with 66 additions and 0 deletions

28
stock/Dockerfile Normal file
View File

@ -0,0 +1,28 @@
# 使用 Ubuntu 最新的 x86_64 版本
FROM --platform=linux/amd64 ubuntu:latest
# 设置时区环境变量
ENV TZ=Asia/Shanghai
RUN apt update && apt install -y tzdata && ln -sf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
# 安装必要的系统包
RUN apt update && \
apt install -y python3 python3-pip git wget curl unzip nano && \
apt clean && rm -rf /var/lib/apt/lists/*
# 设置 Python 环境
RUN pip install --upgrade pip && \
pip install --upgrade cloudscraper requests BeautifulSoup4 lxml pymysql futu-api cryptography
# 设置 Git 配置
RUN git config --global user.name "oscar" && \
git config --global user.email "oscar@easyprompt8.com" && \
git config --global credential.helper store
# 复制 FutuOpenD 安装包(假设你事先下载了 FutuOpenD
# 如果你希望 Docker 自动下载,可以在 ENTRYPOINT 里手动执行
# COPY FutuOpenD.tar.gz /root/
# RUN tar -xzf /root/FutuOpenD.tar.gz -C /root/ && rm /root/FutuOpenD.tar.gz
# 启动时进入 bash 交互模式
CMD ["/bin/bash"]

38
stock/docker-compose.yml Normal file
View File

@ -0,0 +1,38 @@
---
services:
stock:
image: stock:latest # 指定了镜像名
build:
context: .
dockerfile: Dockerfile
container_name: stock
restart: unless-stopped
platform: linux/x86_64 # 强制使用 x86_64 平台
networks:
- devops # 你之前创建的 devops 网络
environment:
- TZ=Asia/Shanghai
ports:
- "1080:80"
volumes:
- ~/Documents/codes/common:/root/projects # 挂载git工程目录
# mkdir -p ~/dockers/stock/{hostdir,config}
- ~/dockers/stock/hostdir:/root/hostdir # 挂载一个通用的主机目录
- ~/dockers/stock/config:/root/config # 挂载一个通用的主机目录
- ~/dockers/sharedata:/root/sharedata # 挂载一个docker之间共享的目录
- ~/dockers/stock/.ssh:/root/.ssh # 允许 SSH 访问 git 仓库
# touch ~/dockers/stock/.gitconfig
- ~/dockers/stock/.gitconfig:/root/.gitconfig # 共享 Git 配置文件
stdin_open: true
tty: true
networks:
devops:
external: true # 你已有的 devops 网络