Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 'integration' to 'master' #124

Merged
merged 165 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
165 commits
Select commit Hold shift + click to select a range
4b89284
Add PDF/UA options
evgeniy-prudnikov Jun 8, 2021
ffb80d3
Merge pull request #64 from jenechkaaaaaaaaaaa/integration
bdoubrov Jun 10, 2021
2cbc5e3
FEAT: veraPDF 1.20 support
carlwilson Jan 27, 2022
2cdafda
Add PDF/A-4 flavours
MaximPlusov Jan 18, 2022
b6c6a8e
Merge pull request #70 from MaximPlusov/integration
carlwilson Feb 9, 2022
ae05b56
Merge branch 'master' into integration
carlwilson Sep 15, 2022
b0b9b24
Merge remote-tracking branch 'origin/rel/1.20' into integration
carlwilson Sep 15, 2022
ff61a3b
FEAT: GitHub Actions build.
carlwilson Sep 15, 2022
29a2788
FIX: Use wget action.
carlwilson Sep 15, 2022
7450615
Fixed processing handler creation
Aug 31, 2022
9abf581
Merge pull request #73 from irinamavrina/dev
carlwilson Sep 27, 2022
fbdf2ec
Merge branch 'integration' into gh-actions
carlwilson Nov 9, 2022
eff225f
FIX: Build artefact name.
carlwilson Nov 9, 2022
a899b3a
FIX: Disabled Swagger generation
carlwilson Nov 9, 2022
276f30a
FIX: Detached process on GH Actions
carlwilson Nov 9, 2022
6bbce5f
FEAT: Better Docker build
carlwilson Nov 12, 2022
ede9ad3
FEAT: GitHub Actions Docker test
carlwilson Nov 12, 2022
6b9038f
FIX: Reference for workflow
carlwilson Nov 12, 2022
eb9f47e
FIX: Callable workflow syntax.
carlwilson Nov 12, 2022
45fabde
FIX: Callable workflow syntax.
carlwilson Nov 12, 2022
7123607
FIX: Callable workflow syntax.
carlwilson Nov 12, 2022
35d431e
FIX: Callable workflow syntax.
carlwilson Nov 12, 2022
0251531
FIX: Callable workflow syntax.
carlwilson Nov 12, 2022
b065fba
FIX: Removed build step leftover.
carlwilson Nov 12, 2022
e0e176e
FIX: Added checkout for Dockerfile.
carlwilson Nov 12, 2022
bda44f8
FIX: Using correct ref for build.
carlwilson Nov 12, 2022
17bc8d5
FIX: Using correct ref for build.
carlwilson Nov 12, 2022
2ecd07f
FIX: Using correct ref for build.
carlwilson Nov 12, 2022
2f4c051
FIX: Checkout syntax.
carlwilson Nov 12, 2022
91f9370
FIX: Using correct ref for build.
carlwilson Nov 12, 2022
e65ca48
FIX: Using correct ref for build.
carlwilson Nov 12, 2022
a706061
FIX: Using correct ref for build.
carlwilson Nov 12, 2022
33eaf08
FIX: Using correct ref for build.
carlwilson Nov 12, 2022
87b47fd
FIX: Copy server.yml from source repo.
carlwilson Nov 13, 2022
45537b4
FEAT: Dev Docker file
carlwilson Nov 14, 2022
b2ae5cd
FIX: Create log dir as root.
carlwilson Nov 14, 2022
7c0c0d6
FEAT: Local source build for GitHub
carlwilson Nov 14, 2022
118e69d
FEAT: Delete container from GH registry.
carlwilson Nov 14, 2022
b6dc101
FEAT: Delete container from GH registry.
carlwilson Nov 14, 2022
8354b31
FEAT: Delete container from GH registry.
carlwilson Nov 14, 2022
64ead4b
FEAT: Delete container from GH registry.
carlwilson Nov 14, 2022
ddef3ba
FEAT: Delete container from GH registry.
carlwilson Nov 14, 2022
8c79879
FIX: Use Personal Access Token.
carlwilson Nov 14, 2022
4cab690
FEAT: Test build without purge
carlwilson Nov 14, 2022
2f613e3
FEAT: Added scheduled job to clear containers.
carlwilson Nov 14, 2022
c014a59
FEAT: Deploy and test container.
carlwilson Nov 14, 2022
d30a569
FEAT: Deploy and test container.
carlwilson Nov 14, 2022
28424f0
FIX: Job dependencies.
carlwilson Nov 14, 2022
e7fb710
FIX: Container reference case.
carlwilson Nov 14, 2022
294089e
FIX: Pass container port to service.
carlwilson Nov 14, 2022
cc44e32
FIX: GitHub Actions build and test
carlwilson Nov 14, 2022
0c8ddc4
FIX: Removed 404 api call.
carlwilson Nov 14, 2022
d6efad3
FIX: Use bridge network names.
carlwilson Nov 14, 2022
a5e5b53
FIX: Use localhost names on runner.
carlwilson Nov 14, 2022
996b9b4
TEST: Tweak the network setup.
carlwilson Nov 14, 2022
567a8bb
TEST: Call workflow by SHA.
carlwilson Nov 14, 2022
b6d9d6e
TEST: Call workflow by SHA.
carlwilson Nov 14, 2022
ae9af68
TEST: Call workflow by SHA.
carlwilson Nov 14, 2022
fff805e
TEST: Desperate shot at port 80.
carlwilson Nov 15, 2022
a5da9cb
TEST: Desperate shot at 0.0.0.0.
carlwilson Nov 15, 2022
7b36796
TEST: Trying new network setup.
carlwilson Nov 15, 2022
2ed83cb
TEST: Trying new network setup.
carlwilson Nov 15, 2022
885e3a8
FIX: Typo in job name.
carlwilson Nov 15, 2022
742e781
FIX: Codacy warnings in Dockerfiles.
carlwilson Nov 15, 2022
6e485ba
Merge pull request #74 from veraPDF/gh-actions
carlwilson Nov 23, 2022
60284fd
FEAT: Publish integration jars to GH Maven registry
carlwilson Jan 12, 2023
89fd302
Merge pull request #75 from veraPDF/gh-actions
carlwilson Jan 12, 2023
85634ef
FIX: Repo ID.
carlwilson Jan 12, 2023
bb6c28d
Merge pull request #76 from veraPDF/gh-actions
carlwilson Jan 12, 2023
c43a6ce
Update pom.xml
MaximPlusov May 17, 2023
cebd336
Merge pull request #79 from veraPDF/update_pom
bdoubrov May 19, 2023
b769caf
Update parent version in pom.xml
MaximPlusov Jun 27, 2023
7c6ab61
Merge pull request #81 from veraPDF/update_pom
MaximPlusov Jun 27, 2023
b9e27c6
Update action for publish to Github Packages
MaximPlusov Jun 27, 2023
c2a5a81
Merge pull request #82 from veraPDF/publish_packages
MaximPlusov Jun 27, 2023
f542e10
Update action for publish to Github Packages
MaximPlusov Jun 27, 2023
aa60135
Merge pull request #83 from veraPDF/publish_packages
MaximPlusov Jun 27, 2023
901d035
Update action for publish to Github Packages
MaximPlusov Jun 27, 2023
8b8695d
Merge pull request #84 from veraPDF/publish_packages
MaximPlusov Jun 27, 2023
c3dedb5
Update action for publish to Github Packages
MaximPlusov Jun 27, 2023
722e9d3
Merge pull request #85 from veraPDF/publish_packages
MaximPlusov Jun 27, 2023
7591161
Update action for publish to Github Packages
MaximPlusov Jun 28, 2023
e420bcb
Merge pull request #86 from veraPDF/publish_packages
MaximPlusov Jun 28, 2023
8497bbf
Update action for publish to Github Packages
MaximPlusov Jun 28, 2023
d9796bd
Merge pull request #87 from veraPDF/publish_packages
MaximPlusov Jun 28, 2023
275c1a9
Update action for publish to Github Packages
MaximPlusov Jun 28, 2023
f6ddaeb
Merge pull request #88 from veraPDF/publish_packages
MaximPlusov Jun 28, 2023
bda5bc7
Update action for publish to Github Packages
MaximPlusov Jun 28, 2023
925f356
Merge pull request #89 from veraPDF/publish_packages
MaximPlusov Jun 28, 2023
58473d0
Update action for publish to Github Packages
MaximPlusov Jun 28, 2023
436f48a
Update docker github actions
MaximPlusov Jul 6, 2023
33a4813
Merge pull request #90 from veraPDF/docker_actions
MaximPlusov Jul 6, 2023
b4d7e6e
FIX: Purge old Docker images
carlwilson Jul 6, 2023
28ff91b
Merge pull request #91 from veraPDF/carlwilson-patch-1
carlwilson Jul 6, 2023
a6f676b
FIX: Add wildcard to container name.
carlwilson Jul 6, 2023
4aa2b67
Add actions for dockerhub pushing
MaximPlusov Jul 7, 2023
cdfd9a0
Merge pull request #93 from veraPDF/docker_actions
MaximPlusov Jul 7, 2023
a0eb29c
Update actions for dockerhub pushing
MaximPlusov Jul 7, 2023
57d22d7
Merge pull request #94 from veraPDF/docker_actions
MaximPlusov Jul 7, 2023
84e5fd1
Merge pull request #92 from veraPDF/fix/container-purge
carlwilson Jul 11, 2023
175acd4
REL 1.24 - Update verapdf dependency
MaximPlusov Jul 11, 2023
a3c1e9b
Merge pull request #95 from veraPDF/rel1.24
MaximPlusov Jul 11, 2023
3f5dfda
FEAT: Versioning for REST server
carlwilson Jul 12, 2023
5866096
FIX: JavaScript style warnings.
carlwilson Jul 12, 2023
2a2a332
FIX: Broken workflow branch ref.
carlwilson Jul 12, 2023
4e6fa87
Merge pull request #96 from veraPDF/feat/version-server
carlwilson Jul 12, 2023
61c0620
Fixed validation result format
May 12, 2023
873e939
Merge pull request #77 from veraPDF/validation-result-format
MaximPlusov Jul 13, 2023
868a3a5
Add config files
May 16, 2023
c179e34
Update Dockerfile_dev
MaximPlusov Jul 14, 2023
9d1399a
Merge pull request #78 from veraPDF/add-config-files
MaximPlusov Jul 21, 2023
78fe6fc
Update reports
MaximPlusov Jul 21, 2023
ab6d145
Merge pull request #97 from veraPDF/update_reports
bdoubrov Jul 31, 2023
43fdde4
Fixed form data after pager reload
daryaromanchuk Aug 24, 2023
0abae5f
Merge pull request #104 from veraPDF/bugfix/page-reload
daryaromanchuk Aug 25, 2023
0664f83
#17 added download report button
daryaromanchuk Aug 22, 2023
1e553fa
Merge pull request #105 from veraPDF/feature/report-button
daryaromanchuk Aug 25, 2023
7b52599
Fixed form issues
daryaromanchuk Aug 24, 2023
fd29d3d
Merge pull request #106 from veraPDF/bugfix/form-issues
daryaromanchuk Aug 25, 2023
bfa4c1f
Update README.md (#98)
bdoubrov Aug 30, 2023
4318fa6
Added UI improvements
daryaromanchuk Aug 30, 2023
302486c
Merge pull request #108 from veraPDF/feature/UI-improvements
daryaromanchuk Aug 30, 2023
e939c40
Fix the case if the title of a document is too long & modified pdf na…
daryaromanchuk Sep 1, 2023
a7abff0
Merge pull request #110 from veraPDF/feature/large-pdf-names
daryaromanchuk Sep 1, 2023
34fba6c
Disabled "Download" button if the report has not been uploaded and va…
daryaromanchuk Sep 1, 2023
a922089
Merge pull request #111 from veraPDF/bugfix/download-btn
daryaromanchuk Sep 1, 2023
cfb3ec4
Add validation by url pdf
EkaterinaKomar Aug 31, 2023
ad80edb
Merge pull request #109 from veraPDF/feature/url-pdf
MaximPlusov Sep 5, 2023
9772baf
Add swagger documentation
EkaterinaKomar Aug 18, 2023
1a8c3e6
Merge pull request #100 from veraPDF/feature/swagger
MaximPlusov Sep 11, 2023
a2e52f5
FIX: Docker SSL URL downloads
carlwilson Sep 15, 2023
d6e40a0
TIDY: Removed commented code.
carlwilson Sep 15, 2023
27314d3
Merge pull request #114 from veraPDF/fix/docker-ssl
carlwilson Sep 15, 2023
588efb3
Add https scheme to swagger
EkaterinaKomar Sep 15, 2023
87b1781
Merge pull request #113 from veraPDF/feature/swagger
EkaterinaKomar Sep 19, 2023
cda2586
Add information to README.md
EkaterinaKomar Sep 13, 2023
3e09c62
Merge pull request #112 from veraPDF/feature/url-pdf
EkaterinaKomar Sep 19, 2023
84e6bc7
Add github action for publishing images to GitHub Packages
MaximPlusov Sep 19, 2023
b494935
Merge pull request #115 from veraPDF/github_publish
MaximPlusov Sep 19, 2023
529b8fc
Fix github action for publishing images to GitHub Packages
MaximPlusov Sep 19, 2023
db300b2
Merge pull request #116 from veraPDF/github_publish
MaximPlusov Sep 19, 2023
cda42ee
Fix github action for publishing images to GitHub Packages
MaximPlusov Sep 19, 2023
8e248ae
Merge pull request #117 from veraPDF/github_publish
MaximPlusov Sep 19, 2023
41c0f49
Fix github action for publishing images to GitHub Packages
MaximPlusov Sep 19, 2023
726e21a
Merge pull request #118 from veraPDF/github_publish
MaximPlusov Sep 19, 2023
c8ccb3b
Update dropwizard and swagger versions
EkaterinaKomar Sep 19, 2023
ce64f32
Merge pull request #119 from veraPDF/feature/upgrade-dropwizard
EkaterinaKomar Sep 20, 2023
b1cc733
Make HTTPS scheme default scheme
EkaterinaKomar Sep 20, 2023
6375505
Merge pull request #120 from veraPDF/feature/swagger
EkaterinaKomar Sep 20, 2023
77c66ef
Update github image name
MaximPlusov Sep 22, 2023
5931a77
Merge pull request #121 from veraPDF/github_publish
MaximPlusov Sep 26, 2023
17adc7b
Update actions for test and purge images
MaximPlusov Sep 27, 2023
5ef04e2
Merge pull request #125 from veraPDF/github_publish
MaximPlusov Sep 27, 2023
20bed75
Update readme
MaximPlusov Sep 23, 2023
eedbed4
Merge pull request #122 from veraPDF/update_readme
MaximPlusov Sep 28, 2023
98b98a8
Add exception to url validation (#127)
EkaterinaKomar Sep 29, 2023
588ec07
Add endpoints and parameters description (#123)
EkaterinaKomar Sep 29, 2023
57bb21e
Added link to Swagger
bdoubrov Sep 29, 2023
a767801
Merge pull request #128 from veraPDF/readme-update-swagger
MaximPlusov Oct 2, 2023
b37031e
Use master branch for docker image
MaximPlusov Oct 2, 2023
d48245a
Merge pull request #129 from veraPDF/docker_master
MaximPlusov Oct 2, 2023
2d8476b
Fix action for pushing images to github
MaximPlusov Oct 2, 2023
c9068db
Merge pull request #130 from veraPDF/github_publish
MaximPlusov Oct 2, 2023
0b10c7b
Remove fixerFolder from processor creation
MaximPlusov Oct 2, 2023
6487e61
Merge pull request #131 from veraPDF/fixer-folder
MaximPlusov Oct 2, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/purge-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Purge GitHub container registry.

on:
workflow_dispatch:
# Runs daily at midnight
schedule:
- cron: '0 0 * * *'

jobs:
purge-images:
name: Delete old untagged images from ghcr.io
runs-on: ubuntu-latest
steps:
- name: Delete all PR containers older than a week
uses: snok/container-retention-policy@v2
with:
image-names: verapdf-rest:pr*, rest:pr*
cut-off: 1 week ago UTC
account-type: org
org-name: veraPDF
keep-at-least: 1
untagged-only: false
token: ${{ secrets.PAT }}
34 changes: 34 additions & 0 deletions .github/workflows/push-dockerhub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Publish Docker image

on:
push:
branches: [ master ]

jobs:
push_to_registry:
name: Push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3

- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: verapdf/rest

- name: Build and push Docker image
uses: docker/build-push-action@3b5e8027fcad23fda98b2e3ac259d8d67585f671
with:
context: .
file: ./Dockerfile
push: true
tags: verapdf/rest:latest,verapdf/rest:v1.24.1
labels: ${{ steps.meta.outputs.labels }}
41 changes: 41 additions & 0 deletions .github/workflows/push-github.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish image to GitHub Packages
on:
push:
branches:
- 'integration'

env:
REGISTRY: ghcr.io
IMAGE_NAME: veraPDF/rest

jobs:
publish:
name: Build and push Docker image to GitHub packages
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for GitHub
id: meta
uses: docker/metadata-action@v2
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
file: Dockerfile
build-args: GH_CHECKOUT=integration
tags: ghcr.io/verapdf/rest:dev
labels: ${{ steps.meta.outputs.labels }}

38 changes: 38 additions & 0 deletions .github/workflows/test-dkr-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Build Docker test container

on:
workflow_call

env:
REGISTRY: ghcr.io
IMAGE_NAME: veraPDF/rest

jobs:
push_to_registry:
name: Build and push Docker image to GitHub packages
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v2
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}

- name: Build and push Docker image
uses: docker/build-push-action@v2
with:
context: .
push: true
file: Dockerfile_dev
tags: ghcr.io/verapdf/rest:pr-${{github.event.number}}
labels: ${{ steps.meta.outputs.labels }}
22 changes: 22 additions & 0 deletions .github/workflows/test-dkr-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Test Docker deployment

on:
workflow_call

jobs:
test:
name: Deploy and test image
runs-on: ubuntu-latest
container: ubuntu
services:
verarest:
image: ghcr.io/verapdf/rest:pr-${{ github.event.pull_request.number }}
ports:
- 8080:8080
steps:
- name: Install wget
run: apt-get update; apt-get install wget -y
- name: Test Profiles endpoint
run: wget -O- http://verarest:8080/api/profiles
- name: Test 1B profile endpoint
run: wget -O- http://verarest:8080/api/profiles/1b
37 changes: 37 additions & 0 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: PR QA

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
build:
name: Checkout and Build
runs-on: ubuntu-latest

strategy:
matrix:
java-version: [8, 11, 16, 17]

steps:
- uses: actions/checkout@v3

- name: JDK setup
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java-version }}
distribution: 'temurin'
cache: maven

- name: Build with Maven
run: mvn --batch-mode --update-snapshots verify

docker_build:
name: Build a test Docker image and add to GH container registry
needs: [ build ]
uses: veraPDF/veraPDF-rest/.github/workflows/test-dkr-build.yml@integration

docker_test:
name: Deploy and test the image built in previous step
needs: [ docker_build ]
uses: veraPDF/veraPDF-rest/.github/workflows/test-dkr-image.yml@integration
10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Ignore Maven artifacts
target/
.idea/
*.iml
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
Expand All @@ -10,8 +9,15 @@ dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties

# Ignore VS code
.vscode

# Ignore Eclipse artifacts
.project
.settings
.classpath
bin/

# Ignore IDEA files
.idea/
*.iml
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

65 changes: 53 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,68 @@
# See https://docs.docker.com/engine/userguide/eng-image/multistage-build/

FROM maven as builder
# First build the app on a maven open jdk 11 container
FROM maven:3.8.6-openjdk-11 as app-builder
WORKDIR /build

# A specifc git branch, tag or commit to build from, defaults to master (release build)
ARG GH_CHECKOUT
ENV GH_CHECKOUT=${GH_CHECKOUT:-master}

# Clone the repo, checkout the revision and build the application
RUN git clone https://github.com/veraPDF/veraPDF-rest.git
RUN cd veraPDF-rest && git checkout integration && mvn clean package

WORKDIR /build/veraPDF-rest
RUN git checkout ${GH_CHECKOUT} && mvn clean package

# Install dumb-init for process safety
# https://github.com/Yelp/dumb-init
RUN wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64

# Now build a Java JRE for the Alpine application image
# https://github.com/docker-library/docs/blob/master/eclipse-temurin/README.md#creating-a-jre-using-jlink
FROM eclipse-temurin:11 as jre-builder

FROM openjdk:8-jre-alpine
# Create a custom Java runtime
RUN "$JAVA_HOME/bin/jlink" \
--add-modules java.base,java.logging,java.xml,java.management,java.sql,java.desktop,jdk.crypto.ec \
--strip-debug \
--no-man-pages \
--no-header-files \
--compress=2 \
--output /javaruntime

ENV VERAPDF_REST_VERSION=0.1.0-SNAPSHOT
# Now the final application image
FROM debian:bullseye-slim

# Set for additional arguments passed to the java run command, no default
ARG JAVA_OPTS
ENV JAVA_OPTS=$JAVA_OPTS
# Specify the veraPDF REST version if you want to (to be used in build automation), default is 0.1.0-SNAPSHOT
ARG VERAPDF_REST_VERSION
ENV VERAPDF_REST_VERSION=${VERAPDF_REST_VERSION:-0.2.0-SNAPSHOT}

COPY --from=app-builder /usr/local/bin/dumb-init /usr/local/bin/dumb-init
RUN chmod +x /usr/local/bin/dumb-init

# Copy the JRE from the previous stage
ENV JAVA_HOME=/opt/java/openjdk
ENV PATH "${JAVA_HOME}/bin:${PATH}"
COPY --from=jre-builder /javaruntime $JAVA_HOME

# Since this is a running network service we'll create an unprivileged account
# which will be used to perform the rest of the work and run the actual service:
RUN useradd --system --user-group --home-dir=/opt/verapdf-rest verapdf-rest
RUN mkdir --parents /var/opt/verapdf-rest/logs && chown -R verapdf-rest:verapdf-rest /var/opt/verapdf-rest

# Debian:
# RUN useradd --system --user-group --home-dir=/opt/verapdf-rest verapdf-rest
# Alpine / Busybox:
RUN install -d -o root -g root -m 755 /opt && adduser -h /opt/verapdf-rest -S verapdf-rest
USER verapdf-rest
WORKDIR /opt/verapdf-rest

COPY --from=builder /build/veraPDF-rest/target/verapdf-rest-${VERAPDF_REST_VERSION}.jar /opt/verapdf-rest/
COPY --from=builder /build/veraPDF-rest/server.yml /opt/verapdf-rest/
# Copy the application from the previous stage
COPY --from=app-builder /build/veraPDF-rest/target/verapdf-rest-${VERAPDF_REST_VERSION}.jar /opt/verapdf-rest/
# Copy the default configuration file
COPY --from=app-builder /build/veraPDF-rest/server.yml /var/opt/verapdf-rest/config/
COPY --from=app-builder /build/veraPDF-rest/config /opt/verapdf-rest/config/

VOLUME /var/opt/verapdf-rest
EXPOSE 8080
ENTRYPOINT java -jar /opt/verapdf-rest/verapdf-rest-${VERAPDF_REST_VERSION}.jar server server.yml

ENTRYPOINT dumb-init java $JAVA_OPTS -Djava.awt.headless=true -jar /opt/verapdf-rest/verapdf-rest-${VERAPDF_REST_VERSION}.jar server /var/opt/verapdf-rest/config/server.yml
65 changes: 65 additions & 0 deletions Dockerfile_dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# See https://docs.docker.com/engine/userguide/eng-image/multistage-build/
# First build the app on a maven open jdk 11 container
FROM maven:3.8.6-openjdk-11 as dev-builder
WORKDIR /build

# Copy the current dev source branch to a local build dir
COPY src/ /build/veraPDF-rest/src/
COPY pom.xml /build/veraPDF-rest/

WORKDIR /build/veraPDF-rest
RUN mvn clean package

# Install dumb-init for process safety
# https://github.com/Yelp/dumb-init
RUN wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.5/dumb-init_1.2.5_x86_64

# Now build a Java JRE for the Alpine application image
# https://github.com/docker-library/docs/blob/master/eclipse-temurin/README.md#creating-a-jre-using-jlink
FROM eclipse-temurin:11 as jre-builder

# Create a custom Java runtime
RUN "$JAVA_HOME/bin/jlink" \
--add-modules java.base,java.logging,java.xml,java.management,java.sql,java.desktop,jdk.crypto.ec \
--strip-debug \
--no-man-pages \
--no-header-files \
--compress=2 \
--output /javaruntime

# Now the final application image
FROM debian:bullseye-slim

# Set for additional arguments passed to the java run command, no default
ARG JAVA_OPTS
ENV JAVA_OPTS=$JAVA_OPTS
# Specify the veraPDF REST version if you want to (to be used in build automation), default is 0.1.0-SNAPSHOT
ARG VERAPDF_REST_VERSION
ENV VERAPDF_REST_VERSION=${VERAPDF_REST_VERSION:-0.2.0-SNAPSHOT}

COPY --from=dev-builder /usr/local/bin/dumb-init /usr/local/bin/dumb-init
RUN chmod +x /usr/local/bin/dumb-init

# Copy the JRE from the previous stage
ENV JAVA_HOME=/opt/java/openjdk
ENV PATH "${JAVA_HOME}/bin:${PATH}"
COPY --from=jre-builder /javaruntime $JAVA_HOME

# Since this is a running network service we'll create an unprivileged account
# which will be used to perform the rest of the work and run the actual service:
RUN useradd --system --user-group --home-dir=/opt/verapdf-rest verapdf-rest
RUN mkdir --parents /var/opt/verapdf-rest/logs && chown -R verapdf-rest:verapdf-rest /var/opt/verapdf-rest

USER verapdf-rest

WORKDIR /opt/verapdf-rest
# Copy the application from the previous stage
COPY --from=dev-builder /build/veraPDF-rest/target/verapdf-rest-${VERAPDF_REST_VERSION}.jar /opt/verapdf-rest/
# Copy the default configuration file
COPY server.yml /var/opt/verapdf-rest/config/
COPY config /opt/verapdf-rest/config/

VOLUME /var/opt/verapdf-rest
EXPOSE 8080

ENTRYPOINT dumb-init java $JAVA_OPTS -Djava.awt.headless=true -jar /opt/verapdf-rest/verapdf-rest-${VERAPDF_REST_VERSION}.jar server /var/opt/verapdf-rest/config/server.yml
Loading
Loading