-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
51 lines (47 loc) · 1.63 KB
/
Copy pathdocker-compose.yml
File metadata and controls
51 lines (47 loc) · 1.63 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
version: '3.9'
services:
# ─── MongoDB ──────────────────────────────────────────────────────────────────
mongo:
image: mongo:7
container_name: campuscoin-mongo
restart: unless-stopped
ports:
- '27017:27017'
volumes:
- mongo_data:/data/db
healthcheck:
test: echo 'db.runCommand("ping").ok' | mongosh --quiet
interval: 10s
timeout: 5s
retries: 5
# ─── Backend API ──────────────────────────────────────────────────────────────
backend:
build: ./backend
container_name: campuscoin-api
restart: unless-stopped
ports:
- '5000:5000'
depends_on:
mongo:
condition: service_healthy
environment:
NODE_ENV: production
PORT: 5000
MONGO_URI: mongodb://mongo:27017/campuscoin
JWT_SECRET: ${JWT_SECRET:-change_me_in_production}
JWT_EXPIRES_IN: 7d
CLIENT_ORIGIN: http://localhost,http://localhost:80
# ─── Frontend PWA ─────────────────────────────────────────────────────────────
frontend:
build:
context: ./frontend
args:
VITE_API_URL: http://localhost:5000
container_name: campuscoin-web
restart: unless-stopped
ports:
- '80:80'
depends_on:
- backend
volumes:
mongo_data: