docker-compose
This commit is contained in:
17
cqrs-sink/Dockerfile
Normal file
17
cqrs-sink/Dockerfile
Normal 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
17
cqrs-source/Dockerfile
Normal 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
43
docker-compose.yaml
Normal 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
|
||||
Reference in New Issue
Block a user