refactor: 改用 Nitro 插件实现启动时数据库迁移
This commit is contained in:
+10
-8
@@ -1,24 +1,26 @@
|
||||
services:
|
||||
app:
|
||||
build: .
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
ports:
|
||||
- '3000:3000'
|
||||
environment:
|
||||
- DATABASE_URL=postgres://postgres:postgres@db:5432/postgres
|
||||
DATABASE_URL: postgres://postgres:postgres@db:5432/postgres
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
|
||||
db:
|
||||
image: postgres:18
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
image: postgres:17-alpine
|
||||
# ports:
|
||||
# - '5432:5432'
|
||||
environment:
|
||||
POSTGRES_USER: postgres
|
||||
POSTGRES_PASSWORD: postgres
|
||||
POSTGRES_DB: postgres
|
||||
volumes:
|
||||
- pgdata:/var/lib/postgresql/data
|
||||
healthcheck:
|
||||
test: [ 'CMD', 'pg_isready', '-U', 'postgres' ]
|
||||
test: ['CMD', 'pg_isready', '-U', 'postgres']
|
||||
interval: 5s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
Reference in New Issue
Block a user