我使用了以下docker-compose.yml
报错:Failed to resolve 'halodb_8080:3307,数据库无法解析
version: "3"
services:
halo:
image: halohub/halo:2.11
container_name: halo_8080
restart: on-failure:3
depends_on:
halodb:
condition: service_healthy
networks:
halo_network:
volumes:
- ./halo2:/root/.halo2
ports:
- "8080:8090"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8090/actuator/health/readiness"]
interval: 30s
timeout: 5s
retries: 5
start_period: 30s
command:
- --spring.r2dbc.url=r2dbc:pool:mysql://halodb_8080:3307/halo
- --spring.r2dbc.username=root
- --spring.r2dbc.password=@@@@@@
- --spring.sql.init.platform=mysql
- --halo.external-url=http://47.254.43.129:8080/
halodb:
image: mysql:8.1.0
container_name: halodb_8080
restart: on-failure:3
networks:
halo_network:
command:
- --default-authentication-plugin=caching_sha2_password
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_general_ci
- --explicit_defaults_for_timestamp=true
volumes:
- ./mysql:/var/lib/mysql
- ./mysqlBackup:/data/mysqlBackup
ports:
- "3307:3306"
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1", "--silent"]
interval: 3s
retries: 5
start_period: 30s
environment:
- MYSQL_ROOT_PASSWORD=@@@@@@
- MYSQL_DATABASE=halo
networks:
halo_network: