From 5725a4167d3e382051143758760ad6d890b76963 Mon Sep 17 00:00:00 2001 From: anasabbal Date: Tue, 10 Jan 2023 02:39:06 +0100 Subject: [PATCH] add Dockerfile to notification service and update docker compose --- docker-compose.yml | 40 ++++++++++++++++++++++++++++++++- notification-service/Dockerfile | 18 +++++++++++++++ 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 notification-service/Dockerfile diff --git a/docker-compose.yml b/docker-compose.yml index 6307c56..84e772f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -36,15 +36,53 @@ services: image: eureka-server:latest ports: - "8761:8761" + notification-service: + container_name: notification-service + build: ./notification-service + image: notification-service:latest + depends_on: + - eureka-server + - postgres + port: + - "9090:9090" + driver-service: + container_name: driver-service + build: ./driver-service + image: driver-service:latest + depends_on: + - eureka-server + port: + - "8081:8081" customer-service: container_name: customer-service - build: ./ + build: ./customer-service image: customer-service:latest ports: - "8080:8080" depends_on: - postgres + - eureka-server + zookeeper: + image: confluentinc/cp-zookeeper:latest + environment: + ZOOKEEPER_CLIENT_PORT: 2181 + ZOOKEEPER_TICK_TIME: 2000 + ports: + - 2181:2181 + kafka: + image: confluentinc/cp-kafka:latest + depends_on: + - zookeeper + ports: + - 9092:9092 + environment: + KAFKA_BROKER_ID: 1 + KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 + KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka: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 #networks: # postgres: # driver: bridge diff --git a/notification-service/Dockerfile b/notification-service/Dockerfile new file mode 100644 index 0000000..ea3e8a2 --- /dev/null +++ b/notification-service/Dockerfile @@ -0,0 +1,18 @@ +FROM openjdk:17-alpine + +# label for the image +LABEL Description="Notification- Service" Version="1.0" + +# mount the temp volume +VOLUME /tmp + +# Add the service as app.jar +ADD target/notification-service-1.0-SNAPSHOT.jar notification-service-1.0-SNAPSHOT.jar +# port +EXPOSE 9090 + +# touch the archive for timestamp +#RUN sh -c 'touch /app.jar' + +# entrypoint to the image on run +ENTRYPOINT ["java", "-jar", "notification-service-1.0-SNAPSHOT.jar"] \ No newline at end of file