按照官方文档"创建 Halo + PostgreSQL 的实例"中docker compose的方式创建容器, 会导致docker的日志中出现大量的:FATAL: role "root" does not exist的警报, 建议在halodb的环境变量中加入PGUSER=halo.
halodb:
image: postgres:latest
container_name: halodb
restart: on-failure:3
networks:
halo_network:
volumes:
- ./db:/var/lib/postgresql/data
ports:
- "5432:5432"
healthcheck:
test: [ "CMD", "pg_isready" ]
interval: 10s
timeout: 5s
retries: 5
environment:
- POSTGRES_PASSWORD=openpostgresql
- POSTGRES_USER=halo
- POSTGRES_DB=halo
- PGUSER=halo