以下内容是 docker-compose.yml 内容,相关端口已经在云服务器上开放
version: "3"
services:
halo:
image: halohub/halo:2.3.1
container_name: halo
restart: on-failure:3
depends_on:
halodb:
condition: service_healthy
networks:
halo_network:
volumes:
- ./:/root/.halo2
ports:
- "xxxxx:8090"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:xxxxxx/actuator/health/readiness"]
interval: 30s
timeout: 5s
retries: 5
start_period: 30s
command:
- --spring.r2dbc.url=r2dbc:pool:mysql://halodb:3306/halo
- --spring.r2dbc.username=root
- --spring.r2dbc.password=xxxxxxx
- --spring.sql.init.platform=mysql
- --halo.external-url=http://xxxxxxxxx/
- --halo.security.initializer.superadminusername=admin
- --halo.security.initializer.superadminpassword=xxxxxxx
halodb:
image: mysql:8.0.31
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", "127.0.0.1", "--silent"]
interval: 3s
retries: 5
start_period: 30s
environment:
- MYSQL_ROOT_PASSWORD=xxxxx
- MYSQL_DATABASE=halo
networks:
halo_network: