Skip to content

Commit

Permalink
separate consumer from api and front
Browse files Browse the repository at this point in the history
  • Loading branch information
mariemeSall committed Jan 30, 2024
1 parent 659475f commit 37f3806
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 25 deletions.
26 changes: 3 additions & 23 deletions consumer/consumer-docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,7 @@
version: '3'

services:
api:
build: ../api
image: kafka_api
container_name: kafka_api_container
ports:
- "8000:8000"
volumes:
- ../api:/app
networks:
- archimicroprojet_kafka_net


kafka-consumer:
build:
Expand All @@ -24,20 +15,9 @@ services:
POSTGRES_DB: coordonnee
networks:
- archimicroprojet_kafka_net


front :
build: ../front
image: kafka_front
container_name: kafka_front_container
ports:
- "4200:4200"
volumes :
- ../front:/app
command: ng serve --host 0.0.0.0
networks:
- archimicroprojet_kafka_net
depends_on:
- api



networks:
Expand Down
32 changes: 30 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,44 @@ services:
ports:
- "9092:9092"
environment:
KAFKA_LISTENERS: INTERNAL://:9092,EXTERNAL_SAME_HOST://:29092,EXTERNAL_DIFFERENT_HOST://:29093,
KAFKA_LISTENERS: INTERNAL://0.0.0.0:9092,EXTERNAL_SAME_HOST://0.0.0.0:29092,EXTERNAL_DIFFERENT_HOST://0.0.0.0:29093,
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka:9092,EXTERNAL_SAME_HOST://localhost:29092,EXTERNAL_DIFFERENT_HOST://172.12.0.1:29093
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL_SAME_HOST:PLAINTEXT,EXTERNAL_DIFFERENT_HOST:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_CREATE_TOPICS: "coordinates:2:1"
KAFKA_CREATE_TOPICS: "coordinates:10:1"

networks:
- kafka_net

front :
build: ./front
image: kafka_front
container_name: kafka_front_container
ports:
- "4200:4200"
volumes :
- ./front:/app
command: ng serve --host 0.0.0.0
networks:
- kafka_net
depends_on:
- api

api:
build: ./api
image: kafka_api
container_name: kafka_api_container
ports:
- "8000:8000"
volumes:
- ./api:/app
networks:
- kafka_net
restart: on-failure
depends_on:
- postgres

networks:
kafka_net:
driver: bridge

0 comments on commit 37f3806

Please sign in to comment.