forked from crackedstudio/tikka
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
146 lines (137 loc) · 3.82 KB
/
Copy pathdocker-compose.yml
File metadata and controls
146 lines (137 loc) · 3.82 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
version: '3.8'
# Profiles:
# deps — postgres + redis only (useful for running services locally)
# backend — deps + backend API
# indexer — deps + indexer
# oracle — deps + oracle
# full — everything except client (backend + indexer + oracle + deps)
# client — adds the Vite dev server (optional; most devs run this locally)
services:
postgres:
image: postgres:16-alpine
profiles: [deps, backend, indexer, oracle, full, client]
environment:
POSTGRES_USER: ${POSTGRES_USER:-tikka}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-tikka-pass}
POSTGRES_DB: ${POSTGRES_DB:-tikka}
ports:
- "5432:5432"
volumes:
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-tikka} -d ${POSTGRES_DB:-tikka}"]
interval: 10s
timeout: 5s
retries: 5
start_period: 10s
redis:
image: redis:7-alpine
profiles: [deps, backend, indexer, oracle, full, client]
# See redis/README.md for the rationale behind these settings.
# noeviction is REQUIRED for BullMQ (queues); AOF persistence keeps
# in-flight jobs alive across restarts.
command:
- redis-server
- --maxmemory-policy
- noeviction
- --appendonly
- "yes"
- --appendfsync
- everysec
ports:
- "6379:6379"
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
start_period: 5s
backend:
build:
context: ./backend
dockerfile: Dockerfile
profiles: [backend, full, client]
ports:
- "3001:3001"
env_file: ./backend/.env.local
environment:
NODE_ENV: development
PORT: 3001
REDIS_URL: redis://redis:6379
INDEXER_URL: http://indexer:3002
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
# The runner image is node:alpine, which ships busybox wget (not curl).
healthcheck:
test: ["CMD-SHELL", "wget -q -O /dev/null http://localhost:3001/health || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 20s
indexer:
build:
context: ./indexer
dockerfile: Dockerfile
profiles: [indexer, full, client]
ports:
- "3002:3002"
env_file: ./indexer/.env.local
environment:
NODE_ENV: development
DATABASE_URL: postgres://${POSTGRES_USER:-tikka}:${POSTGRES_PASSWORD:-tikka-pass}@postgres:5432/${POSTGRES_DB:-tikka}
REDIS_URL: redis://redis:6379
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
# The runner image is node:alpine, which ships busybox wget (not curl).
healthcheck:
test: ["CMD-SHELL", "wget -q -O /dev/null http://localhost:3002/health || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 20s
oracle:
build:
context: ./oracle
dockerfile: Dockerfile
profiles: [oracle, full, client]
ports:
- "3003:3003"
env_file: ./oracle/.env.local
environment:
NODE_ENV: development
REDIS_URL: redis://redis:6379
depends_on:
redis:
condition: service_healthy
# The runner image is node:alpine, which ships busybox wget (not curl).
healthcheck:
test: ["CMD-SHELL", "wget -q -O /dev/null http://localhost:3003/health || exit 1"]
interval: 10s
timeout: 5s
retries: 5
start_period: 20s
client:
build:
context: ./client
dockerfile: Dockerfile
profiles: [client]
ports:
- "5173:5173"
env_file: ./client/.env.local
depends_on:
backend:
condition: service_healthy
networks:
default:
name: tikka-network
volumes:
postgres-data:
redis-data: