[Add]添加web docker中的启动入口
This commit is contained in:
parent
8c85c73d4c
commit
95d12646ea
@ -1,4 +1,4 @@
|
|||||||
# VNPY 的 Docker 镜像
|
# VNC模式的Docker镜像
|
||||||
|
|
||||||
author: [@lamter](https://github.com/lamter) and [@crystalphi](https://github.com/crystalphi)
|
author: [@lamter](https://github.com/lamter) and [@crystalphi](https://github.com/crystalphi)
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ RUN rm /bin/sh && ln -s /bin/bash /bin/sh
|
|||||||
# Install software
|
# Install software
|
||||||
RUN apt-get update
|
RUN apt-get update
|
||||||
RUN apt-get install gcc g++ cmake libboost-all-dev -y
|
RUN apt-get install gcc g++ cmake libboost-all-dev -y
|
||||||
RUN apt-get install git bzip2 -y
|
RUN apt-get install git bzip2 vi nano -y
|
||||||
RUN apt-get install libgl1-mesa-glx libglib2.0 libsm6 libxrender1 -y
|
RUN apt-get install libgl1-mesa-glx libglib2.0 libsm6 libxrender1 -y
|
||||||
|
|
||||||
# Install Anaconda
|
# Install Anaconda
|
||||||
@ -26,4 +26,4 @@ WORKDIR vnpy
|
|||||||
RUN bash install.sh
|
RUN bash install.sh
|
||||||
|
|
||||||
# Set Entry Point
|
# Set Entry Point
|
||||||
ENTRYPOINT python /vnpy/examples/WebTrader/run.py
|
WORKDIR vnpy/examples/WebTrader
|
||||||
|
11
docker/web/README.md
Normal file
11
docker/web/README.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# WebTrader模式的Docker镜像
|
||||||
|
|
||||||
|
本镜像用于展示如何通过Docker来实现vn.py在生产环境中使用的一种快速部署方案,适合策略开发和实盘运维团队分离的专业机构。建议使用中根据自己的需求修改Dockerfile,在构建时加入自主开发的组件和策略。
|
||||||
|
|
||||||
|
使用步骤:
|
||||||
|
1. 在Ubuntu下运行命令安装Docker相关组件:sudo apt install docker docker.io
|
||||||
|
2. 运行build.sh构建镜像webtrader
|
||||||
|
3. 运行run.sh启动基于webtrader镜像的容器
|
||||||
|
4. 进入后使用vi或者nano修改CTP_connect.json中的账户、密码、服务器地址信息
|
||||||
|
5. 运行run.py启动无人值守模式的WebTrader(夜盘开盘前启动,下午收盘后自动关闭)
|
||||||
|
6. Docker中的WebTrader会连接外部环境的MongoDB来加载历史数据,所以请提前安装好
|
4
docker/web/build.sh
Normal file
4
docker/web/build.sh
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# 构建镜像,不使用缓存
|
||||||
|
docker build -t webtrader --no-cache .
|
4
docker/web/run.sh
Normal file
4
docker/web/run.sh
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
# 启动镜像,进入命令行
|
||||||
|
docker run -it --net="host" webtrader
|
Loading…
Reference in New Issue
Block a user