fix: docker-compose 注入 JWT_SECRET + 修复健康检查
This commit is contained in:
@@ -14,4 +14,4 @@ RABBITMQ_USER=admin
|
|||||||
RABBITMQ_PASS=password123
|
RABBITMQ_PASS=password123
|
||||||
|
|
||||||
# JWT (生产环境务必修改为随机强密钥)
|
# JWT (生产环境务必修改为随机强密钥)
|
||||||
JWT_SECRET=change-me-in-production
|
JWT_SECRET=feedsystem-dev-secret-key
|
||||||
|
|||||||
@@ -59,6 +59,8 @@ services:
|
|||||||
dockerfile: backend/Dockerfile
|
dockerfile: backend/Dockerfile
|
||||||
target: api
|
target: api
|
||||||
restart: always
|
restart: always
|
||||||
|
environment:
|
||||||
|
JWT_SECRET: ${JWT_SECRET:-feedsystem-dev-secret-key}
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "8080:8080"
|
||||||
volumes:
|
volumes:
|
||||||
@@ -72,7 +74,7 @@ services:
|
|||||||
rabbitmq:
|
rabbitmq:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
healthcheck:
|
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
|
interval: 10s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 3
|
retries: 3
|
||||||
@@ -83,6 +85,8 @@ services:
|
|||||||
dockerfile: backend/Dockerfile
|
dockerfile: backend/Dockerfile
|
||||||
target: worker
|
target: worker
|
||||||
restart: always
|
restart: always
|
||||||
|
environment:
|
||||||
|
JWT_SECRET: ${JWT_SECRET:-feedsystem-dev-secret-key}
|
||||||
volumes:
|
volumes:
|
||||||
- ./backend/configs/config.docker.yaml:/app/configs/config.yaml:ro
|
- ./backend/configs/config.docker.yaml:/app/configs/config.yaml:ro
|
||||||
depends_on:
|
depends_on:
|
||||||
|
|||||||
Reference in New Issue
Block a user