-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
134 lines (129 loc) · 3.66 KB
/
docker-compose.yml
File metadata and controls
134 lines (129 loc) · 3.66 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
services:
nats:
image: nats:2.10-alpine
command: ["-js"]
ports:
- "${NATS_PORT:-4222}:4222"
restart: unless-stopped
postgres:
image: postgres:16-alpine
environment:
POSTGRES_USER: ${POSTGRES_USER:-orloj}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-orloj}
POSTGRES_DB: ${POSTGRES_DB:-orloj}
ports:
- "${POSTGRES_PORT:-5432}:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-orloj} -d ${POSTGRES_DB:-orloj}"]
interval: 5s
timeout: 3s
retries: 12
restart: unless-stopped
orlojd:
build:
context: .
dockerfile: Dockerfile
target: orlojd
environment:
ORLOJ_POSTGRES_DSN: ${ORLOJ_POSTGRES_DSN:-postgres://orloj:orloj@postgres:5432/orloj?sslmode=disable}
command:
- --addr=:8080
- --storage-backend=postgres
- --task-execution-mode=message-driven
- --event-bus-backend=nats
- --nats-url=nats://nats:4222
- --agent-message-bus-backend=nats-jetstream
- --agent-message-nats-url=nats://nats:4222
volumes:
- /var/run/docker.sock:/var/run/docker.sock
group_add:
- "0"
ports:
- "${ORLOJ_PORT:-8080}:8080"
depends_on:
postgres:
condition: service_healthy
nats:
condition: service_started
healthcheck:
test: ["CMD-SHELL", "wget -q -O - http://127.0.0.1:8080/healthz >/dev/null 2>&1"]
interval: 5s
timeout: 3s
retries: 12
restart: unless-stopped
orlojworker-a:
build:
context: .
dockerfile: Dockerfile
target: orlojworker
environment:
ORLOJ_POSTGRES_DSN: ${ORLOJ_POSTGRES_DSN:-postgres://orloj:orloj@postgres:5432/orloj?sslmode=disable}
command:
- --storage-backend=postgres
- --worker-id=worker-a
- --reconcile-interval=1s
- --lease-duration=30s
- --heartbeat-interval=10s
- --region=default
- --task-execution-mode=message-driven
- --agent-message-bus-backend=nats-jetstream
- --agent-message-nats-url=nats://nats:4222
- --agent-message-consume
- --healthz-addr=:8081
volumes:
- /var/run/docker.sock:/var/run/docker.sock
group_add:
- "0"
depends_on:
postgres:
condition: service_healthy
orlojd:
condition: service_healthy
nats:
condition: service_started
healthcheck:
test: ["CMD-SHELL", "wget -q -O - http://127.0.0.1:8081/healthz >/dev/null 2>&1"]
interval: 5s
timeout: 3s
retries: 12
restart: unless-stopped
orlojworker-b:
build:
context: .
dockerfile: Dockerfile
target: orlojworker
environment:
ORLOJ_POSTGRES_DSN: ${ORLOJ_POSTGRES_DSN:-postgres://orloj:orloj@postgres:5432/orloj?sslmode=disable}
command:
- --storage-backend=postgres
- --worker-id=worker-b
- --reconcile-interval=1s
- --lease-duration=30s
- --heartbeat-interval=10s
- --region=default
- --task-execution-mode=message-driven
- --agent-message-bus-backend=nats-jetstream
- --agent-message-nats-url=nats://nats:4222
- --agent-message-consume
- --healthz-addr=:8081
volumes:
- /var/run/docker.sock:/var/run/docker.sock
group_add:
- "0"
depends_on:
postgres:
condition: service_healthy
orlojd:
condition: service_healthy
nats:
condition: service_started
healthcheck:
test: ["CMD-SHELL", "wget -q -O - http://127.0.0.1:8081/healthz >/dev/null 2>&1"]
interval: 5s
timeout: 3s
retries: 12
restart: unless-stopped
volumes:
postgres_data: