-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
157 lines (147 loc) · 3.42 KB
/
docker-compose.yml
File metadata and controls
157 lines (147 loc) · 3.42 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
services:
# 1. PRIMARY DATABASE
postgres:
image: postgres:15-alpine
container_name: sotto_postgres
restart: unless-stopped
env_file:
- ./infrastructure/.env.docker
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U platform_admin -d sotto_platform_db"]
interval: 10s
timeout: 5s
retries: 5
networks:
- platform_net
# 2. HIGH-VELOCITY DATABASE
scylladb:
image: scylladb/scylla:5.4.1
container_name: sotto_scylla
restart: unless-stopped
# biar ga makan banyak ram
command: --smp 1 --memory 768M --reserve-memory 0 --developer-mode 1
volumes:
- scylla_data:/var/lib/scylla
healthcheck:
test: ["CMD-SHELL", "cqlsh -e 'DESCRIBE KEYSPACES' || exit 1"]
interval: 10s
timeout: 5s
retries: 10
start_period: 30s
networks:
- platform_net
# 3. CACHE & QUEUE BROKER
redis:
image: redis:7-alpine
container_name: sotto_redis
restart: unless-stopped
volumes:
- redis_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
networks:
- platform_net
# 4. OBJECT STORAGE
minio:
image: minio/minio:latest
container_name: sotto_minio
restart: unless-stopped
environment:
MINIO_ROOT_USER: admin_minio
MINIO_ROOT_PASSWORD: supersecret_minio_password
MINIO_API_CORS_ALLOW_ORIGIN: "*"
ports:
- "9000:9000"
- "9001:9001"
command: server /data --console-address ":9001"
volumes:
- minio_data:/data
networks:
- platform_net
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: sotto_backend
restart: unless-stopped
env_file:
- ./infrastructure/.env.docker
depends_on:
postgres:
condition: service_healthy
scylladb:
condition: service_healthy
redis:
condition: service_healthy
minio:
condition: service_started
networks:
- platform_net
# 6. FRONTEND (React Router)
frontend:
build:
context: ./frontend
dockerfile: Dockerfile
container_name: sotto_frontend
restart: unless-stopped
env_file:
- ./infrastructure/.env.docker
depends_on:
- backend
networks:
- platform_net
# 7. REVERSE PROXY (Nginx)
nginx:
image: nginx:alpine
container_name: sotto_nginx
restart: unless-stopped
ports:
- "8080:80"
volumes:
- ./nginx/nginx.dev.conf:/etc/nginx/nginx.conf:ro
depends_on:
- backend
- frontend
networks:
- platform_net
# 8. NGROK TUNNEL (Public URL untuk Midtrans Webhook)
ngrok:
image: ngrok/ngrok:latest
container_name: sotto_ngrok
restart: unless-stopped
command:
- "http"
- "nginx:80"
env_file:
- ./infrastructure/.env.docker
ports:
- "4040:4040"
depends_on:
- nginx
networks:
- platform_net
# 9. CLOUDFLARE TUNNEL (Akses Publik Tanpa VPS)
tunnel:
image: cloudflare/cloudflared:latest
container_name: sotto_tunnel
restart: unless-stopped
command: tunnel --no-autoupdate run
env_file:
- ./infrastructure/.env.docker
depends_on:
- nginx
networks:
- platform_net
networks:
platform_net:
driver: bridge
volumes:
postgres_data:
scylla_data:
redis_data:
minio_data: