Last active
July 22, 2021 21:15
-
-
Save maiermic/4c8384438b7bef04af726cadc03dc023 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.4' | |
services: | |
app: | |
image: busybox | |
# keep container running | |
command: tail -f /dev/null | |
networks: | |
- paymentservice_default | |
- default | |
networks: | |
paymentservice_default: | |
external: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.4' | |
services: | |
app: | |
image: busybox | |
# keep container running | |
command: tail -f /dev/null | |
rabbit: | |
image: rabbitmq | |
networks: | |
default: | |
driver: bridge |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -x | |
COMPOSE_PROJECT_NAME=paymentservice docker-compose -f paymentservice.docker-compose.yml up -d | |
COMPOSE_PROJECT_NAME=other docker-compose -f other.docker-compose.yml up -d | |
docker ps | |
# show Docker IPs | |
docker ps -q | xargs -n 1 docker inspect --format '{{ .Name }} {{range .NetworkSettings.Networks}} {{.IPAddress}}{{end}}' | sed 's#^/##'; | |
docker exec -it other_app_1 ping -c 1 app.paymentservice_default | |
docker exec -it other_app_1 ping -c 1 app | |
# docker exec -it other_app_1 nslookup app | |
docker exec -it other_app_1 nslookup app.paymentservice_default | |
docker exec -it other_app_1 nslookup app | |
COMPOSE_PROJECT_NAME=other docker-compose -f other.docker-compose.yml down | |
COMPOSE_PROJECT_NAME=paymentservice docker-compose -f paymentservice.docker-compose.yml down |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment