-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
121 lines (116 loc) · 3.89 KB
/
docker-compose.yml
File metadata and controls
121 lines (116 loc) · 3.89 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# Docker Compose stack for local databases and applications
services:
mongodb:
image: mongo:7
container_name: mukti-mongodb
restart: unless-stopped
ports:
- '27017:27017'
volumes:
- mongo_data:/data/db
healthcheck:
test: ['CMD', 'mongosh', '--quiet', '--eval', "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: mukti-redis
restart: unless-stopped
ports:
- '6379:6379'
command: ['redis-server', '--save', '60', '1', '--loglevel', 'warning']
volumes:
- redis_data:/data
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 10s
timeout: 5s
retries: 5
seed:
build:
context: .
dockerfile: packages/mukti-api/Dockerfile
container_name: mukti-api-seed
restart: 'no'
command: ['bun', 'dist/seed.js']
environment:
- NODE_ENV=production
- PORT=3000
- MONGODB_URI=mongodb://mongodb:27017/mukti
- REDIS_HOST=redis
- REDIS_PASSWORD=${REDIS_PASSWORD:-}
- REDIS_PORT=6379
- JWT_SECRET=${JWT_SECRET:-dev-secret}
- JWT_EXPIRES_IN=${JWT_EXPIRES_IN:-15m}
- JWT_REFRESH_SECRET=${JWT_REFRESH_SECRET:-dev-refresh-secret}
- JWT_REFRESH_EXPIRES_IN=${JWT_REFRESH_EXPIRES_IN:-30d}
# Public browser-facing frontend URL for email links and callbacks.
- FRONTEND_URL=${FRONTEND_URL:-http://localhost:3001}
depends_on:
mongodb:
condition: service_healthy
redis:
condition: service_healthy
api:
build:
context: .
dockerfile: packages/mukti-api/Dockerfile
container_name: mukti-api
restart: unless-stopped
ports:
- '3000:3000'
environment:
- NODE_ENV=production
- PORT=3000
- MONGODB_URI=mongodb://mongodb:27017/mukti
- REDIS_HOST=redis
- REDIS_PORT=6379
# Default fallbacks, but should be overridden by .env file
- JWT_SECRET=${JWT_SECRET:-dev-secret}
- JWT_EXPIRES_IN=${JWT_EXPIRES_IN:-15m}
- JWT_REFRESH_SECRET=${JWT_REFRESH_SECRET:-dev-refresh-secret}
- JWT_REFRESH_EXPIRES_IN=${JWT_REFRESH_EXPIRES_IN:-30d}
- REDIS_PASSWORD=${REDIS_PASSWORD:-}
- SESSION_SECRET=${SESSION_SECRET:-dev-session-secret}
- OPENROUTER_API_KEY=${OPENROUTER_API_KEY:-}
# Google OAuth (optional — leave blank to disable)
- GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID:-}
- GOOGLE_CLIENT_SECRET=${GOOGLE_CLIENT_SECRET:-}
- GOOGLE_CALLBACK_URL=${GOOGLE_CALLBACK_URL:-http://localhost:3000/api/v1/auth/google/callback}
# Use public DNS names here, not Docker service/container names.
# CORS validates the browser origin, so this should be your real frontend URL.
- FRONTEND_URL=${FRONTEND_URL:-http://localhost:3001}
- CORS_ORIGINS=${CORS_ORIGINS:-http://localhost:3001}
- COOKIE_DOMAIN=${COOKIE_DOMAIN:-localhost}
# This is the browser-facing API base URL. If you reverse proxy API under the
# same domain, set this to that public URL instead of the internal Docker name.
- API_URL=${API_URL:-http://localhost:3000}
depends_on:
mongodb:
condition: service_healthy
redis:
condition: service_healthy
seed:
condition: service_completed_successfully
web:
build:
context: .
dockerfile: packages/mukti-web/Dockerfile
args:
# Browser code must call the public API URL (or same-origin reverse proxy URL),
# not an internal Docker hostname such as http://api:3000.
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL:-http://localhost:3000/api/v1}
container_name: mukti-web
restart: unless-stopped
ports:
- '3001:3000'
environment:
- NODE_ENV=production
- PORT=3000
- NEXT_PUBLIC_API_URL=${NEXT_PUBLIC_API_URL:-http://localhost:3000/api/v1}
depends_on:
- api
volumes:
mongo_data:
redis_data: