java-tutorials/spring-cloud-modules/spring-cloud-docker/docker-compose-restart-poli...

28 lines
698 B
YAML

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