Skip to content

Commit 5956196

Browse files
Fixed problem with running shaded spring jar file in OpenJDK18.
Added docker files to build groupdocs comparison docker images (which are published to docker hub)
1 parent 56aa8f7 commit 5956196

18 files changed

Lines changed: 401 additions & 52 deletions

Demos/Dropwizard/.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.git
22
target
33
client/node_modules
4+
docker
45
Dockerfile
56
DocumentSamples/Temp/*

Demos/Dropwizard/Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ ENV LIC_PATH "Licenses"
1919
ENV DOWNLOAD_ON true
2020
ENV UPLOAD_ON true
2121
ENV PRINT_ON true
22+
ENV BROWSE_ON true
23+
ENV RIGHTCLICK_ON false
2224
ENV FILES_DIR "DocumentSamples"
2325
ENV RESULT_DIR "DocumentSamples"
26+
ENV HOST_ADDRESS ""
2427

2528
EXPOSE 8080
2629

Demos/Dropwizard/Makefile

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
2+
COMPARISON_VERSION = 22.3
3+
4+
# Groupdocs.Comparison for Java - Dropwizard sample
5+
6+
build-openjdk8: VERSION_NAME = openjdk8-bullseye
7+
build-openjdk8:
8+
@echo Building $(COMPARISON_VERSION)-$(VERSION_NAME)-dropwizard
9+
docker build -f ./docker/Dockerfile-$(VERSION_NAME) -t comparison:$(COMPARISON_VERSION)-java-$(VERSION_NAME)-dropwizard ./
10+
11+
build-openjdk11: VERSION_NAME = openjdk11-bullseye
12+
build-openjdk11:
13+
@echo Building $(COMPARISON_VERSION)-$(VERSION_NAME)-dropwizard
14+
docker build -f ./docker/Dockerfile-$(VERSION_NAME) -t comparison:$(COMPARISON_VERSION)-java-$(VERSION_NAME)-dropwizard ./
15+
16+
build-openjdk18: VERSION_NAME = openjdk18-bullseye
17+
build-openjdk18:
18+
@echo Building $(COMPARISON_VERSION)-$(VERSION_NAME)-dropwizard
19+
docker build -f ./docker/Dockerfile-$(VERSION_NAME) -t comparison:$(COMPARISON_VERSION)-java-$(VERSION_NAME)-dropwizard ./
20+
21+
build: build-openjdk8 build-openjdk11 build-openjdk18
22+
23+
run-openjdk8: VERSION_NAME = openjdk8-bullseye
24+
run-openjdk8: CONTAINER_NAME = comparison-$(VERSION_NAME)
25+
run-openjdk8:
26+
@echo Running $(CONTAINER_NAME)
27+
docker run -p 8080:8080 --name $(CONTAINER_NAME) --rm comparison:$(COMPARISON_VERSION)-java-$(VERSION_NAME)-dropwizard
28+
29+
run-openjdk11: VERSION_NAME = openjdk11-bullseye
30+
run-openjdk11: CONTAINER_NAME = comparison-$(VERSION_NAME)
31+
run-openjdk11:
32+
@echo Running $(CONTAINER_NAME)
33+
docker run -p 8080:8080 --name $(CONTAINER_NAME) --rm comparison:$(COMPARISON_VERSION)-java-$(VERSION_NAME)-dropwizard
34+
35+
run-openjdk18: VERSION_NAME = openjdk18-bullseye
36+
run-openjdk18: CONTAINER_NAME = comparison-$(VERSION_NAME)
37+
run-openjdk18:
38+
@echo Running $(CONTAINER_NAME)
39+
docker run -p 8080:8080 --name $(CONTAINER_NAME) --rm comparison:$(COMPARISON_VERSION)-java-$(VERSION_NAME)-dropwizard
40+

Demos/Dropwizard/README.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,19 @@ java -jar comparison-1.8.6.jar configuration.yaml
8282
```
8383

8484
#### Docker image
85-
Use [docker](https://hub.docker.com/u/groupdocs) image.
85+
Use [docker](https://hub.docker.com/r/groupdocs/comparison) image.
86+
87+
There are 3 Dropwizard images available on Docker Hub.
88+
1. `<VERSION>-java-openjdk8-bullseye-dropwizard` - based on OpenJDK 8 and Debian Bullseye
89+
2. `<VERSION>-java-openjdk11-bullseye-dropwizard` - based on OpenJDK 11 and Debian Bullseye
90+
3. `<VERSION>-java-openjdk18-bullseye-dropwizard` - based on OpenJDK 18 and Debian Bullseye
91+
92+
Each can be used to run GroupDocs.Comparison for Java Dropwizard sample
93+
94+
Example:
8695

8796
```bash
88-
mkdir DocumentSamples
89-
mkdir Licenses
90-
docker run -p 8080:8080 --env application.hostAddress=localhost -v `pwd`/DocumentSamples:/home/groupdocs/app/DocumentSamples -v `pwd`/Licenses:/home/groupdocs/app/Licenses groupdocs/comparison
97+
docker run -p 8080:8080 --name my-comparison --rm groupdocs/comparison:22.3-java-openjdk8-bullseye-dropwizard
9198
## Open http://localhost:8080/comparison/ in your favorite browser.
9299
```
93100

Demos/Dropwizard/configuration.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ application:
1818
# Absolute or relative path to GroupDocs license file
1919
licensePath: ${LIC_PATH:-C:/GroupDocs.Total.Java.lic}
2020
# Host name or ip for server instance
21-
hostAddress: ${application.hostAddress}
21+
hostAddress: ${HOST_ADDRESS:-}
2222

2323
################################################
2424
# Common configurations
@@ -42,9 +42,9 @@ common:
4242
print: ${PRINT_ON:-true}
4343
# File browser
4444
# Set false to disable document browse
45-
browse: true
45+
browse: ${BROWSE_ON:-true}
4646
# Set false to disable right mouse click
47-
enableRightClick: true
47+
enableRightClick: ${RIGHTCLICK_ON:-true}
4848
# Session timeout (cache live time) in seconds
4949
sessionTimeout: 600
5050

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Build the project
2+
FROM maven:3-openjdk-11 as builder
3+
COPY pom.xml /usr/local/build/
4+
COPY src /usr/local/build/src/
5+
COPY client /usr/local/build/client/
6+
WORKDIR /usr/local/build
7+
RUN mvn clean package -DskipTests
8+
9+
# Configure Docker Image
10+
FROM openjdk:11-jre-bullseye
11+
12+
RUN apt update && \
13+
echo "deb http://ftp.de.debian.org/debian bullseye main contrib" >> /etc/apt/sources.list && \
14+
apt update && \
15+
apt -y install fontconfig && \
16+
apt -y install ttf-mscorefonts-installer && \
17+
fc-cache -f && \
18+
mkdir -p /home/groupdocs/app && \
19+
mkdir -p /home/groupdocs/app/DocumentSamples && \
20+
mkdir -p /home/groupdocs/app/Licenses
21+
COPY DocumentSamples/source.doc DocumentSamples/target.doc /home/groupdocs/app/DocumentSamples/
22+
COPY configuration.yml /home/groupdocs/app/configuration.yml
23+
COPY --from=builder /usr/local/build/target/comparison-dropwizard-*.jar /home/groupdocs/app/app.jar
24+
WORKDIR /home/groupdocs/app
25+
26+
ENV LIC_PATH "Licenses"
27+
ENV DOWNLOAD_ON true
28+
ENV UPLOAD_ON true
29+
ENV PRINT_ON true
30+
ENV BROWSE_ON true
31+
ENV RIGHTCLICK_ON false
32+
ENV FILES_DIR "DocumentSamples"
33+
ENV RESULT_DIR "DocumentSamples"
34+
ENV HOST_ADDRESS ""
35+
36+
LABEL version="22.3" \
37+
maintainer="GroupDocs Team" \
38+
url="https://products.groupdocs.com/comparison/java" \
39+
documentation="https://docs.groupdocs.com/comparison/java" \
40+
source="https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java" \
41+
description="GroupDocs.Comparison for Java Dropwizard sample, based on Debian Bullseye and OpenJDK 11"
42+
43+
EXPOSE 8080
44+
45+
VOLUME [ "/home/groupdocs/app", "/home/groupdocs/app/DocumentSamples", "/home/groupdocs/app/Licenses" ]
46+
47+
ENTRYPOINT [ "java", "-jar", "app.jar", "configuration.yml" ]
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Build the project
2+
FROM maven:3-openjdk-18 as builder
3+
COPY pom.xml /usr/local/build/
4+
COPY src /usr/local/build/src/
5+
COPY client /usr/local/build/client/
6+
WORKDIR /usr/local/build
7+
RUN mvn clean package -DskipTests
8+
9+
# Configure Docker Image
10+
FROM openjdk:18-jdk-bullseye
11+
12+
RUN apt update && \
13+
echo "deb http://ftp.de.debian.org/debian bullseye main contrib" >> /etc/apt/sources.list && \
14+
apt update && \
15+
apt -y install fontconfig && \
16+
apt -y install ttf-mscorefonts-installer && \
17+
fc-cache -f && \
18+
mkdir -p /home/groupdocs/app && \
19+
mkdir -p /home/groupdocs/app/DocumentSamples && \
20+
mkdir -p /home/groupdocs/app/Licenses
21+
COPY DocumentSamples/source.doc DocumentSamples/target.doc /home/groupdocs/app/DocumentSamples/
22+
COPY configuration.yml /home/groupdocs/app/configuration.yml
23+
COPY --from=builder /usr/local/build/target/comparison-dropwizard-*.jar /home/groupdocs/app/app.jar
24+
WORKDIR /home/groupdocs/app
25+
26+
ENV LIC_PATH "Licenses"
27+
ENV DOWNLOAD_ON true
28+
ENV UPLOAD_ON true
29+
ENV PRINT_ON true
30+
ENV BROWSE_ON true
31+
ENV RIGHTCLICK_ON false
32+
ENV FILES_DIR "DocumentSamples"
33+
ENV RESULT_DIR "DocumentSamples"
34+
ENV HOST_ADDRESS ""
35+
36+
LABEL version="22.3" \
37+
maintainer="GroupDocs Team" \
38+
url="https://products.groupdocs.com/comparison/java" \
39+
documentation="https://docs.groupdocs.com/comparison/java" \
40+
source="https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java" \
41+
description="GroupDocs.Comparison for Java Dropwizard sample, based on Debian Bullseye and OpenJDK 18"
42+
43+
EXPOSE 8080
44+
45+
VOLUME [ "/home/groupdocs/app", "/home/groupdocs/app/DocumentSamples", "/home/groupdocs/app/Licenses" ]
46+
47+
ENTRYPOINT [ "java", "-jar", "app.jar", "configuration.yml" ]
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Build the project
2+
FROM maven:3-openjdk-8 as builder
3+
COPY pom.xml /usr/local/build/
4+
COPY src /usr/local/build/src/
5+
COPY client /usr/local/build/client/
6+
WORKDIR /usr/local/build
7+
RUN mvn clean package -DskipTests
8+
9+
# Configure Docker Image
10+
FROM openjdk:8-jre-bullseye
11+
12+
RUN apt update && \
13+
echo "deb http://ftp.de.debian.org/debian bullseye main contrib" >> /etc/apt/sources.list && \
14+
apt update && \
15+
apt -y install fontconfig && \
16+
apt -y install ttf-mscorefonts-installer && \
17+
fc-cache -f && \
18+
mkdir -p /home/groupdocs/app && \
19+
mkdir -p /home/groupdocs/app/DocumentSamples && \
20+
mkdir -p /home/groupdocs/app/Licenses
21+
COPY DocumentSamples/source.doc DocumentSamples/target.doc /home/groupdocs/app/DocumentSamples/
22+
COPY configuration.yml /home/groupdocs/app/configuration.yml
23+
COPY --from=builder /usr/local/build/target/comparison-dropwizard-*.jar /home/groupdocs/app/app.jar
24+
WORKDIR /home/groupdocs/app
25+
26+
ENV LIC_PATH "Licenses"
27+
ENV DOWNLOAD_ON true
28+
ENV UPLOAD_ON true
29+
ENV PRINT_ON true
30+
ENV BROWSE_ON true
31+
ENV RIGHTCLICK_ON false
32+
ENV FILES_DIR "DocumentSamples"
33+
ENV RESULT_DIR "DocumentSamples"
34+
ENV HOST_ADDRESS ""
35+
36+
LABEL version="22.3" \
37+
maintainer="GroupDocs Team" \
38+
url="https://products.groupdocs.com/comparison/java" \
39+
documentation="https://docs.groupdocs.com/comparison/java" \
40+
source="https://github.com/groupdocs-comparison/GroupDocs.Comparison-for-Java" \
41+
description="GroupDocs.Comparison for Java Dropwizard sample, based on Debian Bullseye and OpenJDK 8"
42+
43+
EXPOSE 8080
44+
45+
VOLUME [ "/home/groupdocs/app", "/home/groupdocs/app/DocumentSamples", "/home/groupdocs/app/Licenses" ]
46+
47+
ENTRYPOINT [ "java", "-jar", "app.jar", "configuration.yml" ]

Demos/Spring/.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
.git
22
target
33
client/node_modules
4+
docker
45
Dockerfile
56
DocumentSamples/temp/*

Demos/Spring/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ ENV DOWNLOAD_ON true
2020
ENV UPLOAD_ON true
2121
ENV PRINT_ON true
2222
ENV BROWSE_ON true
23+
ENV RIGHTCLICK_ON false
2324
ENV FILES_DIR "DocumentSamples"
2425
ENV RESULT_DIR "DocumentSamples"
2526
ENV HOST_ADDRESS ""

0 commit comments

Comments
 (0)