fix(docker): 添加 Kafka/Zookeeper JVM 时区配置

- 添加 KAFKA_OPTS="-Duser.timezone=Asia/Shanghai" 设置 JVM 时区
- 挂载 /usr/share/zoneinfo 确保容器内有完整的时区数据

🤖 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:14:46 -08:00
parent bb16844220
commit 7ae6af7841
1 changed files with 6 additions and 0 deletions

View File

@ -61,9 +61,12 @@ services:
TZ: Asia/Shanghai
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
# Java timezone for confluentinc images
KAFKA_OPTS: "-Duser.timezone=Asia/Shanghai"
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- /usr/share/zoneinfo:/usr/share/zoneinfo:ro
healthcheck:
test: ["CMD", "nc", "-z", "localhost", "2181"]
interval: 10s
@ -91,9 +94,12 @@ services:
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "true"
# Java timezone for confluentinc images
KAFKA_OPTS: "-Duser.timezone=Asia/Shanghai"
volumes:
- /etc/localtime:/etc/localtime:ro
- /etc/timezone:/etc/timezone:ro
- /usr/share/zoneinfo:/usr/share/zoneinfo:ro
healthcheck:
test: ["CMD", "kafka-topics", "--bootstrap-server", "localhost:9092", "--list"]
interval: 30s