Skip to content

Commit 0b27c9d

Browse files
authored
docker examples - add depends on and restart policy (#1267)
* docker compose - add depends on * docker compose - restart on failure
1 parent 81857da commit 0b27c9d

File tree

2 files changed

+27
-2
lines changed

2 files changed

+27
-2
lines changed

docker-examples/docker-compose-postgres.yaml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ services:
4343
golem-shard-manager:
4444
image: golemservices/golem-shard-manager:latest
4545
pull_policy: always
46+
restart: on-failure
4647
environment:
4748
- WASMTIME_BACKTRACE_DETAILS=1
4849
- RUST_BACKTRACE=1
@@ -58,6 +59,7 @@ services:
5859
golem-component-service:
5960
image: golemservices/golem-component-service:latest
6061
pull_policy: always
62+
restart: on-failure
6163
environment:
6264
- ENVIRONMENT=local
6365
- WASMTIME_BACKTRACE_DETAILS=1
@@ -91,6 +93,7 @@ services:
9193
golem-worker-service:
9294
image: golemservices/golem-worker-service:latest
9395
pull_policy: always
96+
restart: on-failure
9497
environment:
9598
- RUST_BACKTRACE=1
9699
- RUST_LOG=info,h2=warn,hyper=warn,tower=warn
@@ -121,10 +124,19 @@ services:
121124
depends_on:
122125
postgres:
123126
condition: service_healthy
127+
redis:
128+
condition: service_started
129+
golem-worker-executor:
130+
condition: service_started
131+
golem-component-service:
132+
condition: service_started
133+
golem-shard-manager:
134+
condition: service_started
124135

125136
golem-component-compilation-service:
126137
image: golemservices/golem-component-compilation-service:latest
127138
pull_policy: always
139+
restart: on-failure
128140
environment:
129141
- RUST_BACKTRACE=1
130142
- RUST_LOG=info,h2=warn,hyper=warn,tower=warn
@@ -147,6 +159,7 @@ services:
147159
golem-worker-executor:
148160
image: golemservices/golem-worker-executor:latest
149161
pull_policy: always
162+
restart: on-failure
150163
environment:
151164
- ENVIRONMENT=local
152165
- WASMTIME_BACKTRACE_DETAILS=1
@@ -173,14 +186,15 @@ services:
173186
- GOLEM__PUBLIC_WORKER_API__PORT=${WORKER_SERVICE_GRPC_PORT}
174187
- GOLEM__PUBLIC_WORKER_API__ACCESS_TOKEN="2A354594-7A63-4091-A46B-CC58D379F677"
175188
- GOLEM__COMPILED_COMPONENT_SERVICE__TYPE="Enabled"
176-
177189
- GOLEM__SHARD_MANAGER_SERVICE__TYPE="Grpc"
178190
volumes:
179191
- worker_executor_store:/worker_executor_store
180192
ports:
181193
- "${WORKER_EXECUTOR_HTTP_PORT}:${WORKER_EXECUTOR_HTTP_PORT}"
182194
depends_on:
183195
- redis
196+
- golem-shard-manager
197+
- golem-component-service
184198

185199
volumes:
186200
redis_data:

docker-examples/docker-compose-sqlite.yaml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ services:
2626
golem-shard-manager:
2727
image: golemservices/golem-shard-manager:latest
2828
pull_policy: always
29+
restart: on-failure
2930
environment:
3031
- WASMTIME_BACKTRACE_DETAILS=1
3132
- RUST_BACKTRACE=1
@@ -41,6 +42,7 @@ services:
4142
golem-component-service:
4243
image: golemservices/golem-component-service:latest
4344
pull_policy: always
45+
restart: on-failure
4446
environment:
4547
- ENVIRONMENT=local
4648
- WASMTIME_BACKTRACE_DETAILS=1
@@ -67,6 +69,7 @@ services:
6769
golem-worker-service:
6870
image: golemservices/golem-worker-service:latest
6971
pull_policy: always
72+
restart: on-failure
7073
environment:
7174
- RUST_BACKTRACE=1
7275
- RUST_LOG=info,h2=warn,hyper=warn,tower=warn
@@ -91,10 +94,16 @@ services:
9194
- "${WORKER_SERVICE_GRPC_PORT}:${WORKER_SERVICE_GRPC_PORT}"
9295
volumes:
9396
- golem_db:/app/golem_db
97+
depends_on:
98+
- redis
99+
- golem-worker-executor
100+
- golem-component-service
101+
- golem-shard-manager
94102

95103
golem-component-compilation-service:
96104
image: golemservices/golem-component-compilation-service:latest
97105
pull_policy: always
106+
restart: on-failure
98107
environment:
99108
- RUST_BACKTRACE=1
100109
- RUST_LOG=info,h2=warn,hyper=warn,tower=warn
@@ -117,6 +126,7 @@ services:
117126
golem-worker-executor:
118127
image: golemservices/golem-worker-executor:latest
119128
pull_policy: always
129+
restart: on-failure
120130
environment:
121131
- ENVIRONMENT=local
122132
- WASMTIME_BACKTRACE_DETAILS=1
@@ -143,14 +153,15 @@ services:
143153
- GOLEM__PUBLIC_WORKER_API__PORT=${WORKER_SERVICE_GRPC_PORT}
144154
- GOLEM__PUBLIC_WORKER_API__ACCESS_TOKEN="2A354594-7A63-4091-A46B-CC58D379F677"
145155
- GOLEM__COMPILED_COMPONENT_SERVICE__TYPE="Enabled"
146-
147156
- GOLEM__SHARD_MANAGER_SERVICE__TYPE="Grpc"
148157
volumes:
149158
- worker_executor_store:/worker_executor_store
150159
ports:
151160
- "${WORKER_EXECUTOR_HTTP_PORT}:${WORKER_EXECUTOR_HTTP_PORT}"
152161
depends_on:
153162
- redis
163+
- golem-shard-manager
164+
- golem-component-service
154165

155166
volumes:
156167
redis_data:

0 commit comments

Comments
 (0)