Skip to content

Commit

Permalink
Merge pull request #3 from NINAnor/build-openrefine
Browse files Browse the repository at this point in the history
Build openrefine from sources
  • Loading branch information
frafra authored Sep 19, 2023
2 parents 06191f5 + e815487 commit 3137b94
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,12 @@ jobs:
fail-fast: false
matrix:
include:
- build_args: version=3.7.5
tag: 3.7.5
- version: master
- version: 4.0
- version: 3.7
- version: 3.7.5
- version: 3.6.2
- version: 3.5.2
permissions:
contents: read
packages: write
Expand All @@ -43,14 +47,14 @@ jobs:
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: ${{ matrix.tag }}
tags: ${{ matrix.version }}
-
name: Build and push container
uses: docker/build-push-action@v3
with:
cache-from: type=gha
cache-to: type=gha,mode=max
push: ${{ github.event_name != 'pull_request' }}
build-args: ${{ matrix.build_args }}
build-args: version=${{ matrix.version }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
26 changes: 20 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
FROM quay.io/centos/centos:stream9-minimal as base
FROM registry.opensuse.org/opensuse/git:latest AS sources
ARG VERSION=3.7.5
WORKDIR /opt/openrefine
RUN git clone https://github.com/OpenRefine/OpenRefine.git --depth 1 --branch $VERSION .

RUN microdnf install --assumeyes --setopt=install_weak_deps=0 java-17-openjdk-headless procps which gettext tar gzip
FROM registry.opensuse.org/opensuse/bci/openjdk-devel:latest AS backend
WORKDIR /opt/openrefine
RUN curl -L https://github.com/OpenRefine/OpenRefine/releases/download/$VERSION/openrefine-linux-$VERSION.tar.gz | \
tar xz --strip-components 1
COPY entrypoint.sh refine.ini.template LICENSE.txt .
COPY --from=sources /opt/openrefine .
RUN --mount=type=cache,target=/root/.m2 \
mvn -B package -P linux -DskipTests=true -Dmaven.antrun.skip=true

EXPOSE 3333/TCP
FROM registry.opensuse.org/opensuse/bci/nodejs:latest AS frontend
WORKDIR /opt/openrefine/main/webapp
COPY --from=sources /opt/openrefine/main/webapp .
RUN --mount=type=cache,target=/root/.npm \
npm install

FROM registry.opensuse.org/opensuse/bci/openjdk:latest
RUN zypper --non-interactive install gettext-tools
WORKDIR /opt/openrefine
COPY --from=backend /opt/openrefine .
COPY --from=frontend /opt/openrefine/main/webapp/modules main/webapp/modules
COPY entrypoint.sh refine.ini.template ./

EXPOSE 3333/TCP
ENV REFINE_MEMORY=1400M
ENV REFINE_MIN_MEMORY=1400M

Expand Down

0 comments on commit 3137b94

Please sign in to comment.