diff --git a/Dockerfile b/Dockerfile index bcdad4f..46749eb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,6 +12,15 @@ RUN apt-get update && apt-get install -y \ # 复制项目文件 COPY . /app/ +# 创建虚拟环境 +RUN python -m venv venv + +# 激活虚拟环境 +RUN source venv/bin/activate + +# 安装setuptools +RUN pip install setuptools + # 安装Python依赖 RUN pip install -r requirements.txt diff --git a/cryptoai/main.py b/cryptoai/main.py index c8aaf82..ce50da3 100644 --- a/cryptoai/main.py +++ b/cryptoai/main.py @@ -19,8 +19,8 @@ from cryptoai.utils.config_loader import ConfigLoader def main(): try: print("程序启动") - # 设置每个整点运行一次 - schedule.every().hour.do(CryptoAgent().start_agent) + # 设置每个4小时运行一次 + schedule.every(4).hours.do(CryptoAgent().start_agent) # 启动定时任务 while True: