docker-compose-示例
1. 新建文件
docker-compose.yml
version: '3'
services:
go-workflow:
container_name: workflow
image: registry.cn-hangzhou.aliyuncs.com/mumushuiding/go-workflow:latest
ports:
- "8080:8080"
environment:
- DbType=mysql
- DbLogMode=false
- DbName=test
- DbHost=mysql
- DbUser=root
- DbPassword=123456
- RedisHost=redis
links:
- redis
- mysql
redis:
container_name: redis
image: redis:5.0
mysql:
container_name: mysql
image: mysql:8.0
command: --default-authentication-plugin=mysql_native_password
restart: always
environment:
MYSQL_ROOT_PASSWORD: 123456
ports:
- 3306
2.构建
docker exec -it workflow bash
# 没有test数据库,无法启动
3.创建msyql test库
mysql uroot -p12345
create database test;
##4. 重新构建
docker exec -it workflow bash
http get http://localhost:8080/workflow/identitylink/findParticipant?procInstID=12562 返回 []
over