services: postgres: image: postgres:16-alpine environment: POSTGRES_DB: bmm POSTGRES_USER: postgres POSTGRES_PASSWORD: 666888 volumes: - postgres_data:/var/lib/postgresql/data # 如果需要外部链接当前数据库,可以放开这里的端口映射 # ports: # - 5432:5432 healthcheck: test: ['CMD', 'pg_isready', '-U', 'postgres', '-d', 'bmm'] interval: 3s timeout: 3s retries: 3 app: image: lcclcc/bmm environment: - DB_DRIVER=postgresql - DB_CONNECTION_URL=postgresql://postgres:666888@postgres:5432/bmm ports: - 3000:3000 depends_on: postgres: condition: service_healthy command: pnpm start volumes: postgres_data: