multiple compose use same network (#12512)
This commit is contained in:
parent
0a84f748e1
commit
4b80c468f1
|
@ -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
|
|
@ -0,0 +1,13 @@
|
|||
services:
|
||||
redis:
|
||||
image: redis:latest
|
||||
container_name: redis
|
||||
ports:
|
||||
- '6379:6379'
|
||||
networks:
|
||||
- network
|
||||
|
||||
networks:
|
||||
network:
|
||||
driver: bridge
|
||||
name: redis_network
|
|
@ -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
|
|
@ -0,0 +1,12 @@
|
|||
services:
|
||||
redis:
|
||||
image: redis:latest
|
||||
container_name: redis
|
||||
ports:
|
||||
- '6379:6379'
|
||||
networks:
|
||||
- network-example
|
||||
|
||||
networks:
|
||||
network-example:
|
||||
external: true
|
Loading…
Reference in New Issue