From e20a57892db357255c97a3e0d9955140dfe95090 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Noco=C5=84?= Date: Wed, 6 Dec 2023 23:59:20 +0100 Subject: [PATCH] [CI] Added Dockerfile for Solr image --- .github/workflows/solr.yaml | 26 ++++++++++++++++++++++++++ docker/solr/Dockerfile | 14 ++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 .github/workflows/solr.yaml create mode 100644 docker/solr/Dockerfile diff --git a/.github/workflows/solr.yaml b/.github/workflows/solr.yaml new file mode 100644 index 0000000000..fc76c9559f --- /dev/null +++ b/.github/workflows/solr.yaml @@ -0,0 +1,26 @@ +name: Build and publish Solr Docker image +on: + workflow_dispatch: ~ + +env: + IMAGE_NAME: ghcr.io/ibexa/core/solr + +jobs: + build-and-publish: + runs-on: ubuntu-latest + permissions: + packages: write + steps: + - uses: actions/checkout@v3 + - name: Log in to the Container registry + uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + - name: Build image + run: docker build -t "$IMAGE_NAME:latest" docker/solr + - name: Push image + if: github.event_name == 'workflow_dispatch' + run: docker push "$IMAGE_NAME" + diff --git a/docker/solr/Dockerfile b/docker/solr/Dockerfile new file mode 100644 index 0000000000..7f00ba7387 --- /dev/null +++ b/docker/solr/Dockerfile @@ -0,0 +1,14 @@ +FROM alpine:3.18.5 as builder +RUN apk add --no-cache --upgrade bash git curl +RUN adduser --disabled-password user +USER user +WORKDIR /home/user +RUN git clone --depth=1 https://github.com/ibexa/solr.git solr +RUN ./solr/bin/generate-solr-config.sh --destination-dir=config --solr-version=8.6.3 + +FROM solr:8.6.3 +USER root +RUN rm -rf server/solr/configsets/_default/conf/* +USER solr +COPY --from=builder /home/user/config server/solr/configsets/_default/conf +CMD ["solr-precreate", "collection1"]