restart policies configuration for Docker Compose
This commit is contained in:
parent
f62a3ee5ca
commit
0cd4aeca9f
|
@ -0,0 +1,37 @@
|
|||
version: '3'
|
||||
services:
|
||||
message-server:
|
||||
container_name: message-server
|
||||
build:
|
||||
context: docker-message-server
|
||||
dockerfile: Dockerfile
|
||||
image: message-server:latest
|
||||
ports:
|
||||
- 18888:8888
|
||||
networks:
|
||||
- spring-cloud-network
|
||||
deploy:
|
||||
restart_policy:
|
||||
condition: any
|
||||
delay: 5s
|
||||
max_attempts: 3
|
||||
window: 120s
|
||||
product-server:
|
||||
container_name: product-server
|
||||
build:
|
||||
context: docker-product-server
|
||||
dockerfile: Dockerfile
|
||||
image: product-server:latest
|
||||
ports:
|
||||
- 19999:9999
|
||||
networks:
|
||||
- spring-cloud-network
|
||||
deploy:
|
||||
restart_policy:
|
||||
condition: on-failure
|
||||
delay: 3s
|
||||
max_attempts: 5
|
||||
window: 60s
|
||||
networks:
|
||||
spring-cloud-network:
|
||||
driver: bridge
|
|
@ -0,0 +1,27 @@
|
|||
version: '2'
|
||||
services:
|
||||
message-server:
|
||||
container_name: message-server
|
||||
build:
|
||||
context: docker-message-server
|
||||
dockerfile: Dockerfile
|
||||
image: message-server:latest
|
||||
ports:
|
||||
- 18888:8888
|
||||
networks:
|
||||
- spring-cloud-network
|
||||
restart: always
|
||||
product-server:
|
||||
container_name: product-server
|
||||
build:
|
||||
context: docker-product-server
|
||||
dockerfile: Dockerfile
|
||||
image: product-server:latest
|
||||
ports:
|
||||
- 19999:9999
|
||||
networks:
|
||||
- spring-cloud-network
|
||||
restart: on-failure
|
||||
networks:
|
||||
spring-cloud-network:
|
||||
driver: bridge
|
Loading…
Reference in New Issue