multiple compose use same network (#12512)

This commit is contained in:
lucaCambi77 2022-07-21 02:13:46 +02:00 committed by GitHub
parent 0a84f748e1
commit 4b80c468f1
4 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1,13 @@
services:
my_app:
image: web-app:latest
container_name: web-app
ports:
- "8080:8080"
networks:
- my-app
networks:
my-app:
name: redis_network
external: true

View File

@ -0,0 +1,13 @@
services:
redis:
image: redis:latest
container_name: redis
ports:
- '6379:6379'
networks:
- network
networks:
network:
driver: bridge
name: redis_network

View File

@ -0,0 +1,12 @@
services:
my_app:
image: web-app:latest
container_name: web-app
ports:
- "8080:8080"
networks:
- network-example
networks:
network-example:
external: true

View File

@ -0,0 +1,12 @@
services:
redis:
image: redis:latest
container_name: redis
ports:
- '6379:6379'
networks:
- network-example
networks:
network-example:
external: true