Files
angular-nestJs-prisma/docker-compose.yml
2026-03-26 14:10:49 +02:00

65 lines
1.6 KiB
YAML

services:
db:
image: postgres:18-alpine
environment:
POSTGRES_USER: webapp
POSTGRES_PASSWORD: webpass
POSTGRES_DB: webappdb
PGDATA: /var/lib/postgresql/data
ports:
- "5432:5432"
volumes:
- webapp_pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U webapp -d webappdb"]
interval: 10s
timeout: 5s
retries: 5
api:
build:
context: .
dockerfile: ./apps/api/Dockerfile.dev
command: sh -c "pnpm install && pnpm prisma generate && pnpm prisma migrate deploy && pnpm nx serve api"
ports:
- "3000:3000"
environment:
- CI=true
- NODE_ENV=development
- DATABASE_URL=postgresql://webapp:webpass@db:5432/webappdb
- NX_DAEMON=false
- NX_WORKSPACE_DATA_DIRECTORY=/tmp/nx-workspace-data-api
- NX_CACHE_DIRECTORY=/tmp/nx-cache-api
stop_grace_period: 5s
depends_on:
db:
condition: service_healthy
volumes:
- .:/app
- api_node_modules:/app/node_modules
web:
build:
context: .
dockerfile: ./apps/web-app/Dockerfile.dev
command: sh -c "pnpm install && pnpm nx serve web-app --host 0.0.0.0 --port 4200"
ports:
- "4200:4200"
environment:
- CI=true
- NODE_ENV=development
- NX_DAEMON=false
- NX_WORKSPACE_DATA_DIRECTORY=/tmp/nx-workspace-data-web
- NX_CACHE_DIRECTORY=/tmp/nx-cache-web
stop_grace_period: 5s
volumes:
- .:/app
- web_node_modules:/app/node_modules
depends_on:
api:
condition: service_started
volumes:
webapp_pgdata:
api_node_modules:
web_node_modules: