Hitchhiker 是一款开源的 Restful Api 测试工具,支持Schedule, 数据对比,压力测试,支持上传脚本定制请求,可以轻松部署到本地,和你的team成员一起管理Api。
官方文档:
http://doc.hitchhiker-api.com/cn/
curl -O https://raw.githubusercontent.com/brookshi/Hitchhiker/release/deploy/docker/hitchhiker_and_mysql/docker-compose.yml -O https://raw.githubusercontent.com/brookshi/Hitchhiker/release/deploy/docker/hitchhiker_and_mysql/hitchhiker-mysql.cnf
在下载目录下创建文件夹:
mkdir app
mkdir mysql
修改docker-compose.yml文件
version: '2'
services:
hitchhiker:
image: brookshi/hitchhiker:v0.14
container_name: hitchhiker
restart: always
environment:
- HITCHHIKER_DB_HOST=hitchhiker-mysql
- HITCHHIKER_APP_HOST=http://www.fenggese.com:8080/ # should change before deploying.
- HITCHHIKER_DB_USERNAME=root
- MYSQL_ROOT_PASSWORD=hitchhiker
- MYSQL_DATABASE=hitchhiker-prod
# add environment variable to config
ports:
- "8080:8080"
- "11010:11010"
links:
- hitchhiker-mysql:hitchhiker-mysql
volumes:
- ./app/data:/usr/src/Hitchhiker/build/global_data/project
- ./app/backup:/usr/src/Hitchhiker/build/backup
- ./app/logs:/usr/src/Hitchhiker/build/logs
hitchhiker-mysql:
image: mysql:5.7
container_name: hitchhiker-mysql
restart: always
environment:
- MYSQL_ROOT_PASSWORD=hitchhiker
- MYSQL_DATABASE=hitchhiker-prod
volumes:
- ./hitchhiker-mysql.cnf:/etc/mysql/conf.d/hitchhiker.cnf
- ./mysql/data:/var/lib/mysql
docker-compose pull
sudo docker-compose up -d
进入容器:docker exec -it mysql bash
进入mysql: mysql -u root -pxxx
添加用户:
insert into user (id, name, password, email, isActive, isTemp) values(1, 'admin', 'password', 'admin@admin.com', 1, 0);
在浏览器中访问对应ip的8080端口即可。