fix: docker-compose 注入 JWT_SECRET + 修复健康检查
This commit is contained in:
@@ -14,4 +14,4 @@ RABBITMQ_USER=admin
|
||||
RABBITMQ_PASS=password123
|
||||
|
||||
# JWT (生产环境务必修改为随机强密钥)
|
||||
JWT_SECRET=change-me-in-production
|
||||
JWT_SECRET=feedsystem-dev-secret-key
|
||||
|
||||
@@ -59,6 +59,8 @@ services:
|
||||
dockerfile: backend/Dockerfile
|
||||
target: api
|
||||
restart: always
|
||||
environment:
|
||||
JWT_SECRET: ${JWT_SECRET:-feedsystem-dev-secret-key}
|
||||
ports:
|
||||
- "8080:8080"
|
||||
volumes:
|
||||
@@ -72,7 +74,7 @@ services:
|
||||
rabbitmq:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD-SHELL", "wget -qO- --post-data='{}' --header='Content-Type: application/json' http://localhost:8080/account/findByID || exit 1"]
|
||||
test: ["CMD-SHELL", "pgrep api || exit 1"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 3
|
||||
@@ -83,6 +85,8 @@ services:
|
||||
dockerfile: backend/Dockerfile
|
||||
target: worker
|
||||
restart: always
|
||||
environment:
|
||||
JWT_SECRET: ${JWT_SECRET:-feedsystem-dev-secret-key}
|
||||
volumes:
|
||||
- ./backend/configs/config.docker.yaml:/app/configs/config.yaml:ro
|
||||
depends_on:
|
||||
|
||||
Reference in New Issue
Block a user