Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
113 lines (106 loc) · 3.64 KB
/
Copy pathdocker-compose.yml
File metadata and controls
113 lines (106 loc) · 3.64 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
services:
# ── MongoDB ───────────────────────────────────────────────────────────────────
mongo:
image: mongo:7
container_name: urbackend_mongo
restart: unless-stopped
command: ["mongod", "--replSet", "rs0", "--bind_ip_all"]
volumes:
- mongo_data:/data/db
healthcheck:
test:
- CMD-SHELL
- >-
mongosh --quiet --eval 'try { rs.status() } catch (err) {
rs.initiate({_id: "rs0", members: [{_id: 0, host: "mongo:27017"}]})
}; db.hello().isWritablePrimary' | grep true
interval: 5s
timeout: 10s
retries: 10
start_period: 10s
# ── Redis ─────────────────────────────────────────────────────────────────────
redis:
image: redis:latest
container_name: urbackend_redis
restart: unless-stopped
volumes:
- redis_data:/data
# ── Dashboard API (Admin Server) ─────────────────────────────────────────────
dashboard-api:
build:
context: .
dockerfile: ./apps/dashboard-api/Dockerfile
container_name: urbackend_dashboard
restart: unless-stopped
ports:
- '1234:1234'
depends_on:
mongo:
condition: service_healthy
redis:
condition: service_started
env_file:
- path: .env
required: false
environment:
# Override DB URLs to use Docker service names
MONGO_URL: mongodb://mongo:27017/urbackend?replicaSet=rs0
REDIS_URL: redis://redis:6379
NODE_ENV: production
PORT: 1234
# ── Public API (User Server) ──────────────────────────────────────────────────
public-api:
build:
context: .
dockerfile: ./apps/public-api/Dockerfile
container_name: urbackend_public
restart: unless-stopped
ports:
- '1235:1235'
depends_on:
mongo:
condition: service_healthy
redis:
condition: service_started
env_file:
- path: .env
required: false
environment:
MONGO_URL: mongodb://mongo:27017/urbackend?replicaSet=rs0
REDIS_URL: redis://redis:6379
NODE_ENV: production
USER_PORT: 1235
# ── Web Dashboard (Frontend) ──────────────────────────────────────────────────
web-dashboard:
build:
context: .
dockerfile: ./apps/web-dashboard/Dockerfile
args:
- VITE_API_URL=http://localhost:1234
- VITE_PUBLIC_URL=http://localhost:1235
container_name: urbackend_frontend
restart: unless-stopped
ports:
- '5173:80'
depends_on:
- dashboard-api
# ── Web Client (Next.js 14 + shadcn/ui) ──────────────────────────────────────
web-client:
build:
context: .
dockerfile: ./apps/web-client/Dockerfile
container_name: urbackend_web_client
restart: unless-stopped
ports:
- '3000:3000'
depends_on:
- dashboard-api
- public-api
environment:
NEXT_PUBLIC_API_URL: http://localhost:1235
NEXT_PUBLIC_DASHBOARD_API_URL: http://localhost:1234
PORT: 3000
NODE_ENV: production
volumes:
mongo_data:
redis_data: