From 23c24f01932358a09dea6fcf325d779dda015953 Mon Sep 17 00:00:00 2001 From: Fabian Date: Tue, 31 Mar 2020 23:09:21 +0200 Subject: [PATCH] first approach --- docker-compose.yml | 65 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 50 insertions(+), 15 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 4025608..710a520 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,20 +1,55 @@ -version: '3' +version: '3.4' networks: - firstsubnet: - external: false - secondsubnet: - external: false + firstsubnet: + driver: bridge + ipam: + driver: default + config: + - subnet: 192.168.1.0/24 services: - producer: - restart: unless-stopped - image: tormachris/p2p-producer - networks: - - firstsubnet + producer1: + restart: unless-stopped + image: tormachris/p2p-producer + networks: + firstsubnet: + ipv4_address: 192.168.1.11 + producer2: + restart: unless-stopped + image: tormachris/p2p-producer + networks: + firstsubnet: + ipv4_address: 192.168.1.12 - consumer: - restart: unless-stopped - image: tormachris/p2p-consumer - networks: - - firstsubnet + consumer1: + restart: unless-stopped + image: tormachris/p2p-consumer + environment: + - REDIS_URL=192.168.1.31 + networks: + firstsubnet: + ipv4_address: 192.168.1.21 + consumer2: + restart: unless-stopped + image: tormachris/p2p-consumer + environment: + - REDIS_URL=192.168.1.32 + + networks: + firstsubnet: + ipv4_address: 192.168.1.22 + + redis1: + image: redis + restart: unless-stopped + networks: + firstsubnet: + ipv4_address: 192.168.1.31 + + redis2: + image: redis + restart: unless-stopped + networks: + firstsubnet: + ipv4_address: 192.168.1.32