Skip to content

Commit

Permalink
Add docker files for standalone spring application
Browse files Browse the repository at this point in the history
  • Loading branch information
vpa1977 committed Feb 24, 2023
1 parent bbbc7c3 commit 642c4c9
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 0 deletions.
2 changes: 2 additions & 0 deletions benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ Run `./build.sh` to clone and build acmeair project.

Run `docker-compose -f docker-compose.liberty.yml up` to bring up WebSphere liberty.
Run `docker-compose -f docker-compose.tomcat.yml up` to bring up Tomcat.
Run `docker-compose -f docker-compose.standalone-temurin.yml up` to bring up standalone Spring Boot app.

Wait for the application startup and navigate to http://localhost:9080/ to explore the application.

## Chiselled Docker Images

Run `docker-compose -f docker-compose.cliberty.yml up` to bring up chiselled WebSphere liberty.
Run `docker-compose -f docker-compose.ctomcat.yml up` to bring up Tomcat.
Run `docker-compose -f docker-compose.standalone-chisel.yml up` to bring up standalone Spring Boot app.

Wait for the application startup and navigate to http://localhost:9080/ to explore the application.

Expand Down
11 changes: 11 additions & 0 deletions benchmark/acmeair-standalone-chisel/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Uncomment to enable CDS
#FROM eclipse-temurin:8u352-b08-jre-jammy as builder
FROM ubuntu/chiselled-jre:8_edge
#COPY --from=builder /opt/java/openjdk/lib/classlist /usr/lib/jvm/java-8-openjdk-amd64/jre/lib
#COPY --from=builder /bin/sh /bin/sh
#USER root
#RUN /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java -Xshare:dump
#USER app
ADD acmeair-java-2.0.0-SNAPSHOT.jar /
#CMD [ "-Xshare:on", "-jar", "/acmeair-java-2.0.0-SNAPSHOT.jar" ]
CMD [ "-jar", "/acmeair-java-2.0.0-SNAPSHOT.jar" ]
7 changes: 7 additions & 0 deletions benchmark/acmeair-standalone-temurin/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM eclipse-temurin:8u352-b08-jre-jammy

ADD acmeair-java-2.0.0-SNAPSHOT.jar /
# uncomment to enabled CDS
#RUN java -Xshare:dump
#CMD [ "java", "-Xshare:on", "-jar", "/acmeair-java-2.0.0-SNAPSHOT.jar" ]
CMD [ "java", "-jar", "/acmeair-java-2.0.0-SNAPSHOT.jar" ]
4 changes: 4 additions & 0 deletions benchmark/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ mvn clean package -Pexternal-tomcat
cp target/acmeair-java-2.0.0-SNAPSHOT.war ../acmeair-tomcat/
mvn -DskipTests=true package -Pexternal-liberty
cp target/acmeair-java-2.0.0-SNAPSHOT.jar ../acmeair-liberty/
cp target/acmeair-java-2.0.0-SNAPSHOT.jar ../acmeair-standalone-chisel/
cp target/acmeair-java-2.0.0-SNAPSHOT.jar ../acmeair-standalone-temurin/

popd

docker build -t acmeair-liberty acmeair-liberty
docker build -t acmeair-cliberty acmeair-cliberty
docker build -t acmeair-tomcat acmeair-tomcat
docker build -t acmeair-ctomcat acmeair-ctomcat
docker build -t acmeair-standalone-chisel acmeair-standalone-chisel
docker build -t acmeair-standalone-temurin acmeair-standalone-temurin
27 changes: 27 additions & 0 deletions benchmark/docker-compose.standalone-chisel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: '3'
services:
acmeair-db:
container_name: acmeair-db
image: mongo
ports:
- "27017:27017"
networks:
- acme

tomcat:
container_name: acmeair-standalone-temurin
image: acmeair-standalone-temurin
networks:
- acme
ports:
- "9080:8080"
- "9443:8443"
- "7777:7777"
environment:
- MONGO_HOST=acmeair-db
tmpfs:
- /tmp

networks:
acme:
driver: bridge
27 changes: 27 additions & 0 deletions benchmark/docker-compose.standalone-temurin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
version: '3'
services:
acmeair-db:
container_name: acmeair-db
image: mongo
ports:
- "27017:27017"
networks:
- acme

tomcat:
container_name: acmeair-standalone-temurin
image: acmeair-standalone-temurin
networks:
- acme
ports:
- "9080:8080"
- "9443:8443"
- "7777:7777"
environment:
- MONGO_HOST=acmeair-db
tmpfs:
- /tmp

networks:
acme:
driver: bridge

0 comments on commit 642c4c9

Please sign in to comment.