Skip to content

Instantly share code, notes, and snippets.

@coryodaniel
Created October 6, 2020 18:48
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Multiple Docker Compose files sharing a network
---
version: "3"
networks:
local-dev:
driver: bridge
---
version: "3"
services:
shell:
image: busybox
stdin_open: true
tty: true
networks:
- network_local-dev
networks:
network_local-dev:
external: true
---
version: "3"
services:
server:
image: nginx
ports:
- 8000:80
networks:
- network_local-dev
networks:
network_local-dev:
external: true
@coryodaniel
Copy link
Author

Split into three docker compose files:

cd network && docker-compose up -d && sleep 5
# nb4: docker network create network_local-dev --driver bridge
cd server && docker-compose up -d && sleep 5
cd shell && docker-compose run shell sh 

ping server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment