Mrered 手动在 postgres 中创建一个数据库实例 halo2,修改 docker-compose.yaml 后启动
version: "3"
volumes:
halo:
halo_2:
halo_db:
services:
halo:
image: halohub/halo:2.8
container_name: halo
restart: on-failure:3
depends_on:
halodb:
condition: service_healthy
networks:
halo_network:
volumes:
- halo:/root/.halo2
ports:
- "8890: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:postgresql://halodb/halo
- --spring.r2dbc.username=halo
# PostgreSQL 的密码,请保证与下方 POSTGRES_PASSWORD 的变量值一致。
- --spring.r2dbc.password=fakesqlpassword
- --spring.sql.init.platform=postgresql
# 外部访问地址,请根据实际需要修改
- --halo.external-url=https://blog.uijxmug.top
# 初始化的超级管理员用户名
- --halo.security.initializer.superadminusername=fakename
# 初始化的超级管理员密码
- --halo.security.initializer.superadminpassword=fakepassword
halo_2:
image: halohub/halo:2.8
container_name: halo_2
restart: on-failure:3
depends_on:
halodb:
condition: service_healthy
networks:
halo_network:
volumes:
- halo_2:/root/.halo2
ports:
- "8891: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:postgresql://halodb/halo2
- --spring.r2dbc.username=halo
# PostgreSQL 的密码,请保证与下方 POSTGRES_PASSWORD 的变量值一致。
- --spring.r2dbc.password=fakesqlpassword
- --spring.sql.init.platform=postgresql
# 外部访问地址,请根据实际需要修改
- --halo.external-url=https://blog.uijxmug.top
# 初始化的超级管理员用户名
- --halo.security.initializer.superadminusername=fakename
# 初始化的超级管理员密码
- --halo.security.initializer.superadminpassword=fakepassword
halodb:
image: postgres:latest
container_name: halodb
restart: on-failure:3
networks:
halo_network:
volumes:
- halo_db:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: [ "CMD", "pg_isready" ]
interval: 10s
timeout: 5s
retries: 5
environment:
- POSTGRES_PASSWORD=fakesqlpassword
- POSTGRES_USER=halo
- POSTGRES_DB=halo
- PGUSER=halo
networks:
halo_network: