827fb761bd
- Prisma provider 改为 postgresql - docker-compose 新增 postgres 服务(带健康检查) - Dockerfile 移除 sqlite3/template.db,改用 npm install prisma 做运行时 schema 同步 - docker-entrypoint.sh 简化为 prisma db push + node server.js
43 lines
861 B
YAML
43 lines
861 B
YAML
services:
|
|
postgres:
|
|
image: postgres:16-alpine
|
|
container_name: no-whatever-db
|
|
ports:
|
|
- "5432:5432"
|
|
environment:
|
|
POSTGRES_USER: nowhatever
|
|
POSTGRES_PASSWORD: nowhatever
|
|
POSTGRES_DB: nowhatever
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U nowhatever"]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 5
|
|
restart: unless-stopped
|
|
networks:
|
|
- nginx
|
|
|
|
app:
|
|
build: .
|
|
image: no-whatever:latest
|
|
container_name: no-whatever
|
|
ports:
|
|
- "3000:3000"
|
|
environment:
|
|
- DATABASE_URL=postgresql://nowhatever:nowhatever@postgres:5432/nowhatever
|
|
depends_on:
|
|
postgres:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
networks:
|
|
- nginx
|
|
|
|
volumes:
|
|
pgdata:
|
|
|
|
networks:
|
|
nginx:
|
|
external: true
|