From 8282238126d5cf8a04a60039fa1604534ecc5ae9 Mon Sep 17 00:00:00 2001 From: timis1 Date: Sat, 21 Oct 2023 22:49:58 +0300 Subject: [PATCH 1/2] JAVA-25525 Verify reactive-systems module --- reactive-systems/docker-compose.yml | 18 ++++++++++++++++++ reactive-systems/inventory-service/Dockerfile | 2 +- reactive-systems/order-service/Dockerfile | 2 +- reactive-systems/shipping-service/Dockerfile | 2 +- 4 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 reactive-systems/docker-compose.yml diff --git a/reactive-systems/docker-compose.yml b/reactive-systems/docker-compose.yml new file mode 100644 index 0000000000..2e40d1999a --- /dev/null +++ b/reactive-systems/docker-compose.yml @@ -0,0 +1,18 @@ +version: '3' +services: + frontend: + build: ./frontend + ports: + - "80:80" + order-service: + build: ./order-service + ports: + - "8080:8080" + inventory-service: + build: ./inventory-service + ports: + - "8081:8081" + shipping-service: + build: ./shipping-service + ports: + - "8082:8082" \ No newline at end of file diff --git a/reactive-systems/inventory-service/Dockerfile b/reactive-systems/inventory-service/Dockerfile index d37887cf34..d0900decfa 100644 --- a/reactive-systems/inventory-service/Dockerfile +++ b/reactive-systems/inventory-service/Dockerfile @@ -1,3 +1,3 @@ FROM openjdk:8-jdk-alpine -COPY target/inventory-service-async-0.0.1-SNAPSHOT.jar app.jar +COPY target/inventory-service-0.0.1-SNAPSHOT.jar app.jar ENTRYPOINT ["java","-jar","-Dspring.profiles.active=docker","/app.jar"] \ No newline at end of file diff --git a/reactive-systems/order-service/Dockerfile b/reactive-systems/order-service/Dockerfile index 516e088a05..e48c19c2b1 100644 --- a/reactive-systems/order-service/Dockerfile +++ b/reactive-systems/order-service/Dockerfile @@ -1,3 +1,3 @@ FROM openjdk:8-jdk-alpine -COPY target/order-service-async-0.0.1-SNAPSHOT.jar app.jar +COPY target/order-service-0.0.1-SNAPSHOT.jar app.jar ENTRYPOINT ["java","-jar","-Dspring.profiles.active=docker","/app.jar"] \ No newline at end of file diff --git a/reactive-systems/shipping-service/Dockerfile b/reactive-systems/shipping-service/Dockerfile index 4906d1d9a8..ff57bb953d 100644 --- a/reactive-systems/shipping-service/Dockerfile +++ b/reactive-systems/shipping-service/Dockerfile @@ -1,3 +1,3 @@ FROM openjdk:8-jdk-alpine -COPY target/shipping-service-async-0.0.1-SNAPSHOT.jar app.jar +COPY target/shipping-service-0.0.1-SNAPSHOT.jar app.jar ENTRYPOINT ["java","-jar","-Dspring.profiles.active=docker","/app.jar"] \ No newline at end of file From 080dded9a425f505119d9b711af4f9b2e92bf7c0 Mon Sep 17 00:00:00 2001 From: timis1 Date: Sat, 28 Oct 2023 23:45:22 +0300 Subject: [PATCH 2/2] JAVA-25525 Adding other service dependencies to run the project --- reactive-systems/docker-compose.yml | 41 ++++++++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/reactive-systems/docker-compose.yml b/reactive-systems/docker-compose.yml index 2e40d1999a..51e15f6a19 100644 --- a/reactive-systems/docker-compose.yml +++ b/reactive-systems/docker-compose.yml @@ -4,15 +4,54 @@ services: build: ./frontend ports: - "80:80" + zookeeper: + image: confluentinc/cp-zookeeper:latest + environment: + ZOOKEEPER_CLIENT_PORT: 2181 + ZOOKEEPER_TICK_TIME: 2000 + ports: + - 22181:2181 + kafka: + image: confluentinc/cp-kafka:latest + container_name: kafka-broker + depends_on: + - zookeeper + ports: + - 29092:29092 + environment: + KAFKA_BROKER_ID: 1 + KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 + KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka-broker:9092,PLAINTEXT_HOST://localhost:29092 + KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT + KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT + KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 + mongodb: + container_name: mongo-db + image: mongo:6.0 + volumes: + - ~/mongo:/data/db + ports: + - "27017:27017" + healthcheck: + test: exit 0 order-service: build: ./order-service ports: - "8080:8080" + depends_on: + mongodb: + condition: service_healthy inventory-service: build: ./inventory-service ports: - "8081:8081" + depends_on: + mongodb: + condition: service_healthy shipping-service: build: ./shipping-service ports: - - "8082:8082" \ No newline at end of file + - "8082:8082" + depends_on: + mongodb: + condition: service_healthy \ No newline at end of file