Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- version: '3.7'
- services:
- consul:
- image: consul:1.4.0
- container_name: consul
- networks:
- - app_net
- expose:
- - 8500
- ports:
- - 8500:8500
- gateway:
- image: api-gateway:1.0-SNAPSHOT
- container_name: gateway
- depends_on:
- - consul
- networks:
- - app_net
- environment:
- - SPRING_CLOUD_CONSUL_HOST=consul
- - SPRING_H2_CONSOLE_ENABLED=true
- expose:
- - 8081
- ports:
- - 8081:8081
- app1
- image: app1:1.0-SNAPSHOT
- networks:
- - app_net
- environment:
- - SPRING_CLOUD_CONSUL_HOST=consul
- - SPRING_H2_CONSOLE_ENABLED=true
- expose:
- - 8083
- ports:
- - 8083:8083
- app2:
- image: app2:1.0-SNAPSHOT
- networks:
- - app_net
- environment:
- - SPRING_CLOUD_CONSUL_HOST=consul
- - SPRING_H2_CONSOLE_ENABLED=true
- expose:
- - 8092
- ports:
- - 8092:8092
- *************
- Так работает:
- curl -X POST "http://123.123.123.123:2375/v1.39/images/create?fromImage=repos/api-gateway&tag=1.0-SNAPSHOT"
- curl -X POST "http://123.123.123.123:2375/v1.39/containers/front-docker_api-gateway_1/stop"
- curl -X DELETE "http://123.123.123.123:2375/v1.39/containers/front-docker_api-gateway_1"
- curl -H "Content-Type: application/json" -d "{ \"Image\": \"repos/api-gateway:1.0-SNAPSHOT\", \"ExposedPorts\": {\"8081/tcp\": {}},\"Env\":[\"SPRING_CLOUD_CONSUL_HOST=consul\"],\"HostConfig\": {\"PortBindings\": { \"8081/tcp\": [{\"HostPort\": \"8081\"}]}}}" -X POST "http://123.123.123.123:2375/v1.39/containers/create?name=front-docker_api-gateway_1"
- curl -X POST "http://123.123.123.123:2375/v1.39/containers/front-docker_api-gateway_1/start"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement