diff --git a/docker-modules/docker-compose/two-compose-share-same-network/create-network-from-service/docker-compose-my-app-service.yaml b/docker-modules/docker-compose/two-compose-share-same-network/create-network-from-service/docker-compose-my-app-service.yaml new file mode 100644 index 0000000000..42e9eec8a1 --- /dev/null +++ b/docker-modules/docker-compose/two-compose-share-same-network/create-network-from-service/docker-compose-my-app-service.yaml @@ -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 \ No newline at end of file diff --git a/docker-modules/docker-compose/two-compose-share-same-network/create-network-from-service/docker-compose-redis-service.yaml b/docker-modules/docker-compose/two-compose-share-same-network/create-network-from-service/docker-compose-redis-service.yaml new file mode 100644 index 0000000000..ef9573a803 --- /dev/null +++ b/docker-modules/docker-compose/two-compose-share-same-network/create-network-from-service/docker-compose-redis-service.yaml @@ -0,0 +1,13 @@ +services: + redis: + image: redis:latest + container_name: redis + ports: + - '6379:6379' + networks: + - network + +networks: + network: + driver: bridge + name: redis_network diff --git a/docker-modules/docker-compose/two-compose-share-same-network/join-existing-network/docker-compose-my-app-service.yaml b/docker-modules/docker-compose/two-compose-share-same-network/join-existing-network/docker-compose-my-app-service.yaml new file mode 100644 index 0000000000..f3310108ce --- /dev/null +++ b/docker-modules/docker-compose/two-compose-share-same-network/join-existing-network/docker-compose-my-app-service.yaml @@ -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 \ No newline at end of file diff --git a/docker-modules/docker-compose/two-compose-share-same-network/join-existing-network/docker-compose-redis-service.yaml b/docker-modules/docker-compose/two-compose-share-same-network/join-existing-network/docker-compose-redis-service.yaml new file mode 100644 index 0000000000..2cf44a05d6 --- /dev/null +++ b/docker-modules/docker-compose/two-compose-share-same-network/join-existing-network/docker-compose-redis-service.yaml @@ -0,0 +1,12 @@ +services: + redis: + image: redis:latest + container_name: redis + ports: + - '6379:6379' + networks: + - network-example + +networks: + network-example: + external: true