From 25481bc67a6a7c759480cc1a83afd1a08d28b8c3 Mon Sep 17 00:00:00 2001 From: Fabian Date: Tue, 31 Mar 2020 23:55:52 +0200 Subject: [PATCH] redis with consumer --- docker-compose.yml | 52 ++++++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 22 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 710a520..5cc000b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,54 +2,62 @@ version: '3.4' networks: firstsubnet: + external: false driver: bridge ipam: driver: default config: - - subnet: 192.168.1.0/24 + - subnet: 192.168.1.0/24 services: producer1: - restart: unless-stopped - image: tormachris/p2p-producer + image: tormachris/producer networks: firstsubnet: ipv4_address: 192.168.1.11 producer2: - restart: unless-stopped - image: tormachris/p2p-producer + image: tormachris/producer networks: firstsubnet: ipv4_address: 192.168.1.12 - consumer1: - restart: unless-stopped - image: tormachris/p2p-consumer + consumer-api1: + image: tormachris/consumer_api environment: - - REDIS_URL=192.168.1.31 + - REDIS_URL=redis://192.168.1.31 + - LOCAL_UUID=31 networks: firstsubnet: ipv4_address: 192.168.1.21 - consumer2: - restart: unless-stopped - image: tormachris/p2p-consumer - environment: - - REDIS_URL=192.168.1.32 + consumer-api2: + image: tormachris/consumer_api + environment: + - REDIS_URL=redis://192.168.1.32 + - LOCAL_UUID=32 networks: firstsubnet: ipv4_address: 192.168.1.22 + consumer-scheduler1: + image: tormachris/consumer-scheduler + environment: + - REDIS_URL=redis://192.168.1.31 + - INITIAL_SERVERS=192.168.1.22 + + network_mode: "service:consumer-api1" + + consumer-scheduler2: + image: tormachris/consumer-scheduler + environment: + - REDIS_URL=redis://192.168.1.32 + - INITIAL_SERVERS=192.168.1.21 + network_mode: "service:consumer-api2" + redis1: image: redis - restart: unless-stopped - networks: - firstsubnet: - ipv4_address: 192.168.1.31 + network_mode: "service:consumer-api1" redis2: image: redis - restart: unless-stopped - networks: - firstsubnet: - ipv4_address: 192.168.1.32 + network_mode: "service:consumer-api2"