You can deploy AKTools using pre-built Docker images from the Aliyun registry. The image version corresponds to the AKShare version.
1. Download the image
Use docker pull with the specific version tag:
docker pull registry.cn-shanghai.aliyuncs.com/akfamily/aktools:1.8.95
2. Run the image
AKTools supports two modes of operation:
High Performance Mode (Default)
This mode uses Gunicorn as the WSGI server to improve network processing performance.
Run in foreground:
docker run -p 8080:8080 registry.cn-shanghai.aliyuncs.com/akfamily/aktools:1.8.95
Run in background (detached):
docker run -d -p 8080:8080 registry.cn-shanghai.aliyuncs.com/akfamily/aktools:1.8.95
Standard Mode
Runs the application directly using the aktools module.
Run in foreground:
docker run -p 8080:8080 registry.cn-shanghai.aliyuncs.com/akfamily/aktools:1.8.95 python -m aktools --host 0.0.0.0 --port 8080
Run in background (detached):
docker run -d -p 8080:8080 registry.cn-shanghai.aliyuncs.com/akfamily/aktools:1.8.95 python -m aktools --host 0.0.0.0 --port 8080
3. Verify the installation
Once running, access the API via your browser or a tool like curl at:
http://127.0.0.1:8080/api/public/stock_zh_a_hist