#快速开始
Warning
#启动命令
docker
docker-compose
#!/bin/bash
docker rm -f confkeeper
docker run -id \
--name=confkeeper \
--restart=always \
--network=host \
--health-cmd="wget --no-verbose --tries=1 --spider http://localhost:8888/api/ping || exit 1" \
--health-interval=30s \
--health-timeout=10s \
--health-retries=3 \
-v /etc/localtime:/etc/localtime:ro \
-v /etc/timezone:/etc/timezone:ro \
-v $(pwd)/config/config.yaml:/app/config/config.yaml:ro \
buyfakett/confkeeper_dev \
-p=8888 \
-c=/app/config/config.yamlservices:
confkeeper:
stdin_open: true
container_name: confkeeper
network_mode: host
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- $(pwd)/config/config.yaml:/app/config/config.yaml:ro
image: buyfakett/confkeeper_dev
command: -p=8888 -c=/app/config/config.yaml
healthcheck:
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:8888/api/ping || exit 1"]
interval: 30s
timeout: 10s
retries: 3#配置
Tip
所有配置的优先级是命令行>环境变量>指定配置文件>默认配置文件
EASYIMAGE_GO,例如端口为EASYIMAGE_GO_SERVER_PORT以下是默认配置,可以进行修改
server:
port: 8888 # 监听端口
log_level: info # 日志登记
swagger: true # 是否开启swagger
zone: Asia/Shanghai # 时区
captcha_expire_time: 5 # 验证码过期时间(分钟)
admin:
username: admin # 默认管理员账号
password: admin123456 # 默认管理员密码
jwt:
secret: 123qazwsxedc456 # 需要修改成随机数
expire_time: 168
db:
type: sqlite3
database: confkeeper
captcha:
length: 6 # 验证码长度
noise_count: 50 # 验证码干扰个数Tip
数据库配置可以配置多种类型
db:
type: postgres # 如果要用mysql,改成mysql
host: xxx
port: 5432
user: postgres
password: xxx
database: test