Skip to content

Commit

Permalink
Build openrefine from sources
Browse files Browse the repository at this point in the history
  • Loading branch information
frafra committed Sep 19, 2023
1 parent 06191f5 commit 8d74e9e
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 12 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ 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"
permissions:
contents: read
packages: write
Expand All @@ -43,14 +46,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 }}
28 changes: 21 additions & 7 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
ARG VERSION=3.7.5
FROM registry.opensuse.org/opensuse/git:latest AS sources
ARG VERSION=master
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
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ services:
build:
context: .
dockerfile: Dockerfile
args:
VERSION: master
environment:
REFINE_MEMORY: 2000M
REFINE_MIN_MEMORY: 2000M
Expand All @@ -17,7 +19,7 @@ services:
timeout: 10s
interval: 1m0s
retries: 5
image: ghcr.io/ninanor/openrefine:main
image: ghcr.io/ninanor/openrefine:master
networks:
default: null
ports:
Expand Down

0 comments on commit 8d74e9e

Please sign in to comment.