mirror of
https://github.com/EZ-Api/ez-api.git
synced 2026-01-13 17:47:51 +00:00
feat(docker): add dedicated PostgreSQL instance for logs
Add separate log-postgres service to docker-compose stack for storing API logs independently from the main database. - Add log-postgres service with PostgreSQL 15 Alpine image - Configure environment variables for log database credentials - Update ez-api service to depend on log-postgres health check - Set default EZ_LOG_PG_DSN to connect to the new log database - Update .env.example and README with new configuration options
This commit is contained in:
@@ -111,7 +111,7 @@ go run cmd/server/main.go
|
||||
|
||||
### Docker Compose(推荐)
|
||||
|
||||
在 `ez-api` 目录使用自带的 `docker-compose.yml` 拉起完整栈(Postgres + Redis + ez-api + balancer):
|
||||
在 `ez-api` 目录使用自带的 `docker-compose.yml` 拉起完整栈(Postgres + 日志库 + Redis + ez-api + balancer):
|
||||
|
||||
```bash
|
||||
cd ez-api
|
||||
@@ -123,6 +123,9 @@ docker compose up -d
|
||||
```env
|
||||
EZ_ADMIN_TOKEN=admin123
|
||||
EZ_INTERNAL_STATS_TOKEN=internal123
|
||||
LOG_POSTGRES_USER=postgres
|
||||
LOG_POSTGRES_PASSWORD=postgres
|
||||
LOG_POSTGRES_DB=ezapi_logs
|
||||
EZ_BALANCER_LOG_SINK_ENABLED=false
|
||||
EZ_BALANCER_LOG_SINK_BASE_URL=http://ez-api:8080
|
||||
EZ_BALANCER_STATS_FLUSH_ENABLED=false
|
||||
|
||||
Reference in New Issue
Block a user