-
Notifications
You must be signed in to change notification settings - Fork 427
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
219 lines (211 loc) · 5.65 KB
/
Copy pathdocker-compose.yml
File metadata and controls
219 lines (211 loc) · 5.65 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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
services:
db:
image: postgres:18
container_name: postgres__open-wearables
environment:
POSTGRES_DB: open-wearables
POSTGRES_USER: open-wearables
POSTGRES_PASSWORD: open-wearables
ports:
- "${DB_PORT:-5432}:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U open-wearables -d open-wearables"]
interval: 5s
timeout: 5s
retries: 5
volumes:
- postgres_data:/var/lib/postgresql
- ./backend/scripts/init/create-svix-db.sql:/docker-entrypoint-initdb.d/create-svix-db.sql:ro
app:
build:
context: ./backend
dockerfile: Dockerfile
container_name: backend__open-wearables
image: open-wearables-platform:latest
pull_policy: never
command: scripts/start/app.sh
env_file:
- ./backend/config/.env
environment:
- DB_HOST=db
- REDIS_HOST=redis
ports:
- "${API_PORT:-8000}:8000"
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
develop:
watch:
- action: sync
path: ./backend/app
target: /root_project/app
- action: sync+restart
path: ./backend/migrations
target: /root_project/migrations
- action: sync+restart
path: ./backend/config/.env
target: /root_project/config/.env
- action: sync
path: ./backend/scripts
target: /root_project/scripts
- action: sync
path: ./backend/tests
target: /root_project/tests
- action: rebuild
path: ./backend/uv.lock
restart: on-failure
celery-worker:
container_name: celery-worker__open-wearables
image: open-wearables-platform:latest
pull_policy: never
command: scripts/start/worker.sh
env_file:
- ./backend/config/.env
environment:
- DB_HOST=db
- REDIS_HOST=redis
depends_on:
- redis
- db
- app
develop:
watch:
- action: sync+restart
path: ./backend/app
target: /root_project/app
- action: sync
path: ./backend/scripts
target: /root_project/scripts
celery-beat:
container_name: celery-beat__open-wearables
image: open-wearables-platform:latest
pull_policy: never
command: scripts/start/beat.sh
env_file:
- ./backend/config/.env
environment:
- DB_HOST=db
- REDIS_HOST=redis
depends_on:
- redis
- db
- app
develop:
watch:
- action: sync+restart
path: ./backend/app
target: /root_project/app
- action: sync
path: ./backend/scripts
target: /root_project/scripts
flower:
container_name: flower__open-wearables
image: open-wearables-platform:latest
pull_policy: never
command: scripts/start/flower.sh
env_file:
- ./backend/config/.env
environment:
- DB_HOST=db
- REDIS_HOST=redis
ports:
- "${FLOWER_PORT:-5555}:5555"
depends_on:
- redis
- db
- app
develop:
watch:
- action: sync
path: ./backend
target: /root_project
ignore:
- .venv/
redis:
container_name: redis__open-wearables
image: redis:8
entrypoint:
- sh
- -c
- |
# Seed AOF from an existing RDB before enabling it, otherwise Redis boots
# empty and ignores dump.rdb. Skipped once appendonlydir exists.
if [ ! -d /data/appendonlydir ] && [ -f /data/dump.rdb ]; then
redis-server --daemonize no &
RPID=$$!
until redis-cli ping >/dev/null 2>&1; do sleep 0.2; done
redis-cli CONFIG SET appendonly yes
sleep 1
until redis-cli INFO persistence | grep -q 'aof_rewrite_in_progress:0'; do sleep 0.2; done
redis-cli SHUTDOWN NOSAVE
wait "$$RPID" 2>/dev/null
fi
exec redis-server --appendonly yes --appendfsync everysec
ports:
- "${REDIS_PORT:-6379}:6379"
volumes:
- redis_data:/data
svix-server:
container_name: svix-server__open-wearables
image: svix/svix-server:v1
entrypoint:
- sh
- -c
- |
: "$${SVIX_JWT_SECRET:=$$SECRET_KEY}"
export SVIX_JWT_SECRET
exec svix-server "$$@"
- --
command: ["--run-migrations"]
env_file:
- ./backend/config/.env
environment:
SVIX_DB_DSN: "postgresql://${DB_USER:-open-wearables}:${DB_PASSWORD:-open-wearables}@${DB_HOST:-db}:${DB_PORT:-5432}/svix"
SVIX_QUEUE_TYPE: "redis"
SVIX_REDIS_DSN: "redis://redis:6379/1"
SVIX_CACHE_TYPE: "redis"
ports:
- "${SVIX_PORT:-8071}:8071"
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
healthcheck:
test: ["CMD", "svix-server", "healthcheck", "http://localhost:8071"]
interval: 5s
timeout: 3s
retries: 20
start_period: 10s
restart: on-failure
frontend:
build:
context: ./frontend
dockerfile: Dockerfile.dev
container_name: frontend__open-wearables
image: open-wearables-frontend:dev
pull_policy: never
ports:
- "${FRONTEND_PORT:-3000}:3000"
depends_on:
- app
develop:
watch:
- action: sync
path: ./frontend/src
target: /app/src
- action: sync
path: ./frontend/public
target: /app/public
- action: rebuild
path: ./frontend/package.json
- action: rebuild
path: ./frontend/pnpm-lock.yaml
- action: rebuild
path: ./frontend/vite.config.ts
restart: on-failure
volumes:
postgres_data:
redis_data: