docker-compose

This commit is contained in:
amaljoyc
2018-10-12 14:47:05 +02:00
parent 4872a2fc70
commit 3fd5b5b39e
3 changed files with 77 additions and 0 deletions

17
cqrs-sink/Dockerfile Normal file
View File

@@ -0,0 +1,17 @@
# Start with a base image containing Java runtime
FROM openjdk:8-jdk-alpine
# Add a volume pointing to /tmp
VOLUME /tmp
# Make port 8081 available to the world outside this container
EXPOSE 8081
# The application's jar file
ARG JAR_FILE=target/cqrs-sink-1.0.0-SNAPSHOT.jar
# Add the application's jar to the container
ADD ${JAR_FILE} cqrs-sink.jar
# Run the jar file
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/cqrs-sink.jar"]

17
cqrs-source/Dockerfile Normal file
View File

@@ -0,0 +1,17 @@
# Start with a base image containing Java runtime
FROM openjdk:8-jdk-alpine
# Add a volume pointing to /tmp
VOLUME /tmp
# Make port 8080 available to the world outside this container
EXPOSE 8080
# The application's jar file
ARG JAR_FILE=target/cqrs-source-1.0.0-SNAPSHOT.jar
# Add the application's jar to the container
ADD ${JAR_FILE} cqrs-source.jar
# Run the jar file
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/cqrs-source.jar"]

43
docker-compose.yaml Normal file
View File

@@ -0,0 +1,43 @@
version: "2"
services:
sink:
build: ./cqrs-sink
ports:
- 8081:8081
links:
- mysql
- kafka
source:
build: ./cqrs-source
ports:
- 8080:8080
links:
- mysql
- kafka
mysql:
image: mysql
ports:
- 3306:3306
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_USER=myuser
- MYSQL_PASSWORD=mypwd
zookeeper:
image: confluent/zookeeper
ports:
- 2181:2181
- 2888:2888
- 3888:3888
kafka:
image: confluent/kafka
ports:
- 9092:9092
links:
- zookeeper
environment:
- ZOOKEEPER_CONNECT=zookeeper:2181
- ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092