-
Notifications
You must be signed in to change notification settings - Fork 113
Open
Description
发现两个问题:
- 会把 POSTGRES_USER 识别为数据库
- 配置了 .env 端口变量,但还是会使用默认的 5432
root 是超级用户
辛苦大佬们看下
.env
POSTGRES_HOST=xxxx
POSTGRES_PORT=15432
POSTGRES_USER=root
POSTGRES_PASSWORD=111111
POSTGRES_DATABASE=openwebui_monitor
services:
app:
image: docker.io/variantconst/openwebui-monitor:latest
container_name: openwebui-monitor
ports:
- "27878:3000"
env_file:
- .env
environment:
- POSTGRES_HOST=${POSTGRES_HOST:-db}
- POSTGRES_PORT=${POSTGRES_PORT:-5432}
- POSTGRES_USER=${POSTGRES_USER:-postgres}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD:-openwebui}
- POSTGRES_DATABASE=${POSTGRES_DATABASE:-openwebui_monitor}
restart: alwayslog 日志:
Waiting for PostgreSQL to start...
PostgreSQL is up!
Creating database if not exists...
Connection to xxxxxx 15432 port [tcp/*] succeeded!
psql: error: connection to server at "xxxxxx, port 15432 failed: FATAL: database "root" does not exist
psql: error: connection to server at xxxxxx, port 15432 failed: FATAL: database "root" does not exist
Database setup completed!
Initializing database tables...
> openwebui-usage-monitor@0.3.4 db:push /app
> tsx scripts/init-db.ts
Database connection/initialization error: Error: connect ETIMEDOUT xxxxxx:5432
at /app/node_modules/.pnpm/pg-pool@3.7.0_pg@8.13.1/node_modules/pg-pool/index.js:45:11
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at ensureTablesExist (/app/lib/db.ts:65:14)
at init (/app/scripts/init-db.ts:5:5) {
errno: -110,
code: 'ETIMEDOUT',
syscall: 'connect',
address: 'xxxxx',
port: 5432
}
Database initialization failed: Error: connect ETIMEDOUT xxxxx:5432
at /app/node_modules/.pnpm/pg-pool@3.7.0_pg@8.13.1/node_modules/pg-pool/index.js:45:11
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at ensureTablesExist (/app/lib/db.ts:65:14)
at init (/app/scripts/init-db.ts:5:5) {
errno: -110,
code: 'ETIMEDOUT',
syscall: 'connect',
address: 'xxxxxxx',
port: 5432
}
ELIFECYCLE Command failed with exit code 1.Metadata
Metadata
Assignees
Labels
No labels