Prisma Init
This commit is contained in:
+76
-16
@@ -1,27 +1,87 @@
|
||||
services:
|
||||
api:
|
||||
image: node:26-alpine
|
||||
working_dir: /app
|
||||
command: sh -c "npm install -g pnpm && pnpm install && pnpm start:dev"
|
||||
ports:
|
||||
- "${PORT:-3000}:${PORT:-3000}"
|
||||
volumes:
|
||||
- .:/app
|
||||
- node_modules:/app/node_modules
|
||||
environment:
|
||||
PORT: ${PORT:-3000}
|
||||
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
|
||||
depends_on:
|
||||
- postgres
|
||||
|
||||
postgres:
|
||||
image: postgres:18-alpine
|
||||
|
||||
environment:
|
||||
POSTGRES_USER: ${POSTGRES_USER}
|
||||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
||||
POSTGRES_DB: ${POSTGRES_DB}
|
||||
|
||||
volumes:
|
||||
- postgres_data:/var/lib/postgresql/data
|
||||
- postgres_data:/var/lib/postgresql
|
||||
|
||||
healthcheck:
|
||||
test:
|
||||
[
|
||||
"CMD-SHELL",
|
||||
"pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"
|
||||
]
|
||||
interval: 2s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
|
||||
api-dev:
|
||||
profiles: ["dev"]
|
||||
image: node:26-alpine
|
||||
working_dir: /app
|
||||
|
||||
command: >
|
||||
sh -c "
|
||||
npm install -g pnpm@12.5.1 &&
|
||||
pnpm install &&
|
||||
pnpm prisma generate &&
|
||||
pnpm prisma migrate deploy &&
|
||||
pnpm prisma db seed &&
|
||||
pnpm start:dev
|
||||
"
|
||||
|
||||
ports:
|
||||
- "${PORT:-3000}:${PORT:-3000}"
|
||||
|
||||
volumes:
|
||||
- .:/app
|
||||
- node_modules:/app/node_modules
|
||||
|
||||
environment:
|
||||
PORT: ${PORT:-3000}
|
||||
NODE_ENV: development
|
||||
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
|
||||
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
|
||||
api-prod:
|
||||
profiles: ["prod"]
|
||||
image: node:26-alpine
|
||||
working_dir: /app
|
||||
|
||||
command: >
|
||||
sh -c "
|
||||
npm install -g pnpm@12.5.1 &&
|
||||
pnpm install --frozen-lockfile &&
|
||||
pnpm prisma generate &&
|
||||
pnpm prisma migrate deploy &&
|
||||
pnpm prisma db seed &&
|
||||
pnpm build &&
|
||||
pnpm start:prod
|
||||
"
|
||||
|
||||
ports:
|
||||
- "${PORT:-3000}:${PORT:-3000}"
|
||||
|
||||
volumes:
|
||||
- .:/app
|
||||
- node_modules:/app/node_modules
|
||||
|
||||
environment:
|
||||
PORT: ${PORT:-3000}
|
||||
NODE_ENV: production
|
||||
DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
|
||||
|
||||
depends_on:
|
||||
postgres:
|
||||
condition: service_healthy
|
||||
|
||||
volumes:
|
||||
node_modules:
|
||||
|
||||
Reference in New Issue
Block a user