fix(docker): 为 zookeeper 和 kafka 挂载时区文件

confluentinc 镜像不支持 TZ 环境变量,需要挂载宿主机时区文件:
- /etc/localtime
- /etc/timezone

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2025-12-23 19:06:28 -08:00
parent 75606687eb
commit bb16844220
1 changed files with 6 additions and 0 deletions

View File

@ -61,6 +61,9 @@ services:
TZ: Asia/Shanghai
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
healthcheck:
test: ["CMD", "nc", "-z", "localhost", "2181"]
interval: 10s
@ -88,6 +91,9 @@ services:
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
healthcheck:
test: ["CMD", "kafka-topics", "--bootstrap-server", "localhost:9092", "--list"]
interval: 30s