Skip to content

Commit 417c480

Browse files
authored
[CI] Added workflow for publishing the Solr image (#303)
[CI] Added Dockerfile for Solr image
1 parent e22d595 commit 417c480

File tree

2 files changed

+40
-0
lines changed

2 files changed

+40
-0
lines changed

.github/workflows/solr.yaml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Build and publish Solr Docker image
2+
on:
3+
workflow_dispatch: ~
4+
5+
env:
6+
IMAGE_NAME: ghcr.io/ibexa/core/solr
7+
8+
jobs:
9+
build-and-publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
packages: write
13+
steps:
14+
- uses: actions/checkout@v3
15+
- name: Log in to the Container registry
16+
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
17+
with:
18+
registry: ghcr.io
19+
username: ${{ github.actor }}
20+
password: ${{ secrets.GITHUB_TOKEN }}
21+
- name: Build image
22+
run: docker build -t "$IMAGE_NAME:latest" docker/solr
23+
- name: Push image
24+
if: github.event_name == 'workflow_dispatch'
25+
run: docker push "$IMAGE_NAME"
26+

docker/solr/Dockerfile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM alpine:3.18.5 as builder
2+
RUN apk add --no-cache --upgrade bash git curl
3+
RUN adduser --disabled-password user
4+
USER user
5+
WORKDIR /home/user
6+
RUN git clone --depth=1 https://github.com/ibexa/solr.git solr
7+
RUN ./solr/bin/generate-solr-config.sh --destination-dir=config --solr-version=8.6.3
8+
9+
FROM solr:8.6.3
10+
USER root
11+
RUN rm -rf server/solr/configsets/_default/conf/*
12+
USER solr
13+
COPY --from=builder /home/user/config server/solr/configsets/_default/conf
14+
CMD ["solr-precreate", "collection1"]

0 commit comments

Comments
 (0)