-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathdocker-compose.yaml
More file actions
158 lines (153 loc) · 3.8 KB
/
Copy pathdocker-compose.yaml
File metadata and controls
158 lines (153 loc) · 3.8 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
services:
backend:
build:
context: .
dockerfile: ./backend/Dockerfile
ports:
- "8080:8080"
env_file:
- .env
environment:
- POSTGRES_HOST=db
- MINISTACK_URL=http://ministack:4566
- STORAGE_SERVICE_NAME=local
- LOCAL_STORAGE_PATH=/static
depends_on:
db:
condition: service_healthy
ministack:
condition: service_healthy
volumes:
- type: bind
source: ./.data
target: /static
healthcheck:
test: ["CMD-SHELL", "curl --fail http://localhost:8080/healthcheck"]
interval: 60s
retries: 3
start_period: 30s
timeout: 5s
develop:
watch:
- path: ./backend
target: /app/backend
action: sync+restart
- path: ./common
target: /app/common
action: sync+restart
- path: ./uv.lock
action: rebuild
worker:
build:
context: .
dockerfile: ./worker/Dockerfile
shm_size: 4gb
deploy: # Make sure the worker has a couple of CPUS
resources:
limits:
cpus: "2.0" # Set CPU limit to 2 cores
env_file:
- .env
ports:
- "8265:8265"
volumes:
- ${WORKER_TMP:-./.worker-tmp}:/tmp
- type: bind
source: ./.data
target: /static
environment:
- POSTGRES_HOST=db
- RAY_DASHBOARD_HOST=0.0.0.0
- MINISTACK_URL=http://ministack:4566
- STORAGE_SERVICE_NAME=local
- LOCAL_STORAGE_PATH=/static
stop_grace_period: 10s
depends_on:
db:
condition: service_healthy
ministack:
condition: service_healthy
healthcheck:
# Direct interpreter call (venv is on PATH); avoids `uv run` touching
# /app/.venv on a timer while Ray is running off the same venv.
test: ["CMD-SHELL", "python worker/healthcheck.py"]
interval: 60s
retries: 3
start_period: 60s
timeout: 5s
develop:
watch:
- path: ./worker
target: /app/backend
action: sync+restart
- path: ./common
target: /app/common
action: sync+restart
- path: ./uv.lock
action: rebuild
frontend:
build:
context: .
dockerfile: ./frontend/Dockerfile.dev
args:
- NEXT_PUBLIC_SENTRY_DSN=$SENTRY_DSN
- NEXT_PUBLIC_POSTHOG_API_KEY=$POSTHOG_API_KEY
ports:
- "3000:3000"
env_file:
- .env
depends_on:
backend:
condition: service_started
environment:
- BACKEND_HOST=http://backend:8080
- NEXT_PUBLIC_SENTRY_DSN=$SENTRY_DSN
- NEXT_PUBLIC_POSTHOG_API_KEY=$POSTHOG_API_KEY
volumes:
- next_data:/app/.next
develop:
watch:
- path: ./frontend
target: /app
action: sync
ignore:
- node_modules/
- .next/
- path: ./frontend/package.json
action: rebuild
db:
image: postgres:13
user: postgres
env_file:
- .env
volumes:
- local_postgres_data:/var/lib/postgresql/data:Z
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "minute_db"]
interval: 5s
timeout: 30s
retries: 24
start_period: 30s
ministack: # MiniStack container (LocalStack-compatible AWS emulator)
image: ministackorg/ministack:latest
env_file:
- .env
ports:
- 4566:4566
volumes:
# Here you mount your setup file so it will be executed
# when the container starts
- ./ministack-setup.sh:/etc/localstack/init/ready.d/script.sh
environment:
- AWS_DEFAULT_REGION=eu-west-2
healthcheck:
test: ["CMD", "test", "-f", "/ready.txt"]
interval: 1m30s
timeout: 30s
retries: 5
start_period: 30s
volumes:
local_postgres_data: {}
next_data: {}