通过-e 传入数据库配置和 mq 的配置
docker run -d -p 8000:8000 --name httprunnermanager -e DB_USERNAME=root -e DB_PWD=123456 -e DB_HOST=192.168.2.114 -e DB_PORT=3006 -e MQ_URL=guest:guest@192.168.2.1:30672 registry.cn-hongkong.aliyuncs.com/regend/httprunner:latest
apiVersion: apps/v1
kind: Deployment
metadata:
name: httprunnermanager
spec:
replicas: 1
selector:
matchLabels:
app: httprunnermanager
template:
metadata:
labels:
app: httprunnermanager
spec:
containers:
- image: registry.cn-hongkong.aliyuncs.com/regend/httprunner:latest
imagePullPolicy: Always
name: httprunnermanager
ports:
- containerPort: 8000
env:
- name: "DB_USERNAME"
value: "root"
- name: "DB_PWD"
value: "123456"
- name: "DB_HOST"
value: "127.0.0.1"
- name: "DB_PORT"
value: "3306"
- name: "MQ_URL"
value: "guest:guest@192.168.0.1:5672"
- name: "MAIL_NAME"
value: "aa@qq.com"
- name: "MAIL_PWD"
value: "123456"