修改配置后还是还会连接本地数据库
version: "3"
services:
halo:
image: halohub/halo:2.0.2
container_name: halo
restart: on-failure:3
depends_on:
halodb:
condition: service_healthy
networks:
halo_network:
volumes:
- ./:/root/.halo2
ports:
- "8090:8090"
environment:
- SPRING_R2DBC_URL=r2dbc:pool:mysql://halodb:3306/xxx
- SPRING_R2DBC_USERNAME=xxx
MySQL 的密码,请保证与下方 MYSQL_ROOT_PASSWORD 的变量值一致。
- SPRING_R2DBC_PASSWORD=xxx
- SPRING_SQL_INIT_PLATFORM=mysql
外部访问地址,请根据实际需要修改
- HALO_EXTERNAL_URL=http://www.xxx.cn/
初始化的超级管理员用户名
- HALO_SECURITY_INITIALIZER_SUPERADMINUSERNAME=xxx
初始化的超级管理员密码
- HALO_SECURITY_INITIALIZER_SUPERADMINPASSWORD=xxx
halodb:
image: mysql:5.7
container_name: halodb
restart: on-failure:3
networks:
halo_network:
command: --default-authentication-plugin=mysql_native_password
--character-set-server=utf8mb4
--collation-server=utf8mb4_general_ci
--explicit_defaults_for_timestamp=true
volumes:
- ./mysql:/var/lib/mysql
- ./mysqlBackup:/data/mysqlBackup
ports:
- "3306:3306"
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "xxx.xxx.xxx.xxx", "--silent"]
interval: 3s
retries: 5
start_period: 30s
environment:
请修改此密码,并对应修改上方 Halo 服务的 SPRING_R2DBC_PASSWORD 变量值
- MYSQL_ROOT_PASSWORD=xx
- MYSQL_DATABASE=xx
networks:
halo_network: