-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
107 lines (102 loc) · 3.18 KB
/
docker-compose.dev.yml
File metadata and controls
107 lines (102 loc) · 3.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
version: "3.8"
# ============================================
# Development Environment (with Hot Reload)
# ============================================
# Usage:
# docker compose -f docker-compose.dev.yml up
#
# Notes:
# - Code changes reflect in real-time (bind mounts)
# - No rebuilding needed for most changes
# - Backend: NestJS --watch mode
# - Frontend: Next.js dev server with Turbopack
services:
# ============================================
# PostgreSQL Database
# ============================================
postgres:
image: postgres:16-alpine
container_name: docvault-postgres-dev
restart: unless-stopped
environment:
POSTGRES_DB: docvault
POSTGRES_USER: docvault
POSTGRES_PASSWORD: docvault123
PGDATA: /var/lib/postgresql/data/pgdata
ports:
- "5432:5432"
volumes:
- postgres_data_dev:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U docvault -d docvault"]
interval: 10s
timeout: 5s
retries: 5
# ============================================
# Backend (NestJS) - Dev Mode with Watch
# ============================================
backend:
image: node:22-alpine
container_name: docvault-backend-dev
restart: unless-stopped
working_dir: /app
command: >
sh -c "
corepack enable &&
pnpm install &&
pnpm --filter backend exec prisma generate &&
pnpm --filter backend exec prisma migrate deploy &&
pnpm --filter backend start:dev
"
environment:
CI: "true"
DATABASE_URL: postgresql://docvault:docvault123@postgres:5432/docvault
PORT: 3001
JWT_SECRET: ${JWT_SECRET:-k99U1leRjegHt72zilQVNxcVbrT76GxbrMZ82eC/yqE=}
GITHUB_CLIENT_ID: ${GITHUB_CLIENT_ID:-your_github_client_id}
GITHUB_CLIENT_SECRET: ${GITHUB_CLIENT_SECRET:-your_github_client_secret}
GITHUB_REDIRECT_URI: ${GITHUB_REDIRECT_URI:-http://localhost:3001/auth/github/callback}
FRONTEND_URL: ${FRONTEND_URL:-http://localhost:3000}
ports:
- "3001:3001"
- "9229:9229" # Debug port
volumes:
- .:/app
- backend_node_modules:/app/packages/backend/node_modules
depends_on:
postgres:
condition: service_healthy
# ============================================
# Frontend (Next.js) - Dev Mode with Turbopack
# ============================================
frontend:
image: node:22-alpine
container_name: docvault-frontend-dev
restart: unless-stopped
working_dir: /app
command: >
sh -c "
corepack enable &&
pnpm install &&
pnpm --filter frontend dev
"
environment:
CI: "true"
NEXT_PUBLIC_API_URL: http://localhost:3001
GITHUB_CLIENT_ID: ${GITHUB_CLIENT_ID:-your_github_client_id}
AUTH_CALLBACK_URL: http://localhost:3001/auth/github/callback
ports:
- "3000:3000"
volumes:
- .:/app
- frontend_node_modules:/app/packages/frontend/node_modules
depends_on:
- backend
# ============================================
# Volumes
# ============================================
volumes:
postgres_data_dev:
driver: local
backend_node_modules:
frontend_node_modules: