Skip to content

Commit

Permalink
Merge pull request #280 from netlogix/feature/solr-9.5
Browse files Browse the repository at this point in the history
  • Loading branch information
saschanowak authored May 16, 2024
2 parents 99b5d87 + abab50f commit a6c83f2
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
context: ./solr
target: ''
version: ''
file: 9.3.dockerfile
file: 8.Dockerfile
build-args: ''
- name: varnish
context: ./varnish
Expand Down
26 changes: 13 additions & 13 deletions solr/9.3.dockerfile → solr/8.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
# syntax=docker/dockerfile:1
FROM solr:9.3.0 as builder
FROM solr:8.11.3 as builder

ENV TYPO3_SOLR=12.0.0 \
TYPO3_SOLR_DOWNLOAD_SHA512="3bcf68ff22ad58c5ad58aac7d7569823ee53e9d42513592e43e1c295a8ed7c7cd8970506508f1702386321c62dc718e28a6957cceafa0509308fed8233d83d22"
ENV TYPO3_SOLR=11.5.0 \
TYPO3_SOLR_DOWNLOAD_SHA512="a0c0181993606dbaa587520e8aa8988f1b0eb845215828cf31df0dc181497ab4932db03359bc89655366197247210b4a82cbba1b7bcc5abba85545811e17eefe"

USER root

RUN apt-get update && \
apt-get -y install wget tar && \
SOLR_DOWNLOAD_URL="https://github.com/TYPO3-Solr/ext-solr/archive/${TYPO3_SOLR}.tar.gz" && \
wget -t 10 --max-redirect 4 --retry-connrefused -nv "$SOLR_DOWNLOAD_URL" -O "/tmp/solr.tar.gz" && \
echo "$TYPO3_SOLR_DOWNLOAD_SHA512 /tmp/solr.tar.gz" | sha512sum -c - && \
mkdir -p /tmp/solr && \
tar -zxvf /tmp/solr.tar.gz -C /tmp/solr --strip-components=1;
RUN set -ex; \
apt-get update; \
apt-get -y install wget unzip; \
SOLR_DOWNLOAD_URL="https://github.com/TYPO3-Solr/ext-solr/releases/download/$TYPO3_SOLR/solr_$TYPO3_SOLR.zip"; \
wget -t 10 --max-redirect 4 --retry-connrefused -nv "$SOLR_DOWNLOAD_URL" -O "/tmp/solr.zip"; \
echo "$TYPO3_SOLR_DOWNLOAD_SHA512 /tmp/solr.zip" | sha512sum -c -; \
unzip /tmp/solr.zip -d /tmp/solr;

RUN sed -i "s|name=core_|name=website-|i" /tmp/solr/Resources/Private/Solr/cores/*/core.properties \
&& cd /tmp/solr/Resources/Private/Solr/configsets/ext_solr_12_0_0/conf \
&& cd /tmp/solr/Resources/Private/Solr/configsets/ext_solr_11_5_0/conf \
&& for f in _schema_analysis_*_core_*.json; do mv "$f" "$(echo "$f" | sed s/core_/website-/)"; done

FROM solr:9.3.0
FROM solr:8.11.3

ENV SOLR_LOG_LEVEL=WARN \
SOLR_PORT=8983 \
Expand All @@ -32,3 +31,4 @@ COPY --from=builder --chown=solr:solr /tmp/solr/Resources/Private/Solr /var/solr
RUN mkdir -p /var/solr/data/data

HEALTHCHECK --interval=2s --timeout=20s --retries=10 CMD curl -s -A 'healthcheck' http://localhost:$SOLR_PORT/solr/$HEALTHCHECK_CORE/admin/ping?wt=json | grep -q '"status":"OK"'

51 changes: 30 additions & 21 deletions solr/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,43 @@
# syntax=docker/dockerfile:1
FROM solr:8.11.2 as builder
FROM solr:9.5.0 as builder

ENV TYPO3_SOLR=11.5.0 \
TYPO3_SOLR_DOWNLOAD_SHA512="a0c0181993606dbaa587520e8aa8988f1b0eb845215828cf31df0dc181497ab4932db03359bc89655366197247210b4a82cbba1b7bcc5abba85545811e17eefe"
ENV TYPO3_SOLR=12.0.3 \
TYPO3_SOLR_DOWNLOAD_SHA512="882f24a44d221f5d85a2066ab1235c9aedcd31c8a8f2009f9343b73de2931fd354fed6a8175fe18fa6fa0c284dd07d428c4f547f24875129e5a1d57c5ffd283f"

USER root
RUN set -ex; \
apt-get update; \
apt-get -y install wget unzip; \
SOLR_DOWNLOAD_URL="https://github.com/TYPO3-Solr/ext-solr/releases/download/$TYPO3_SOLR/solr_$TYPO3_SOLR.zip"; \
wget -t 10 --max-redirect 4 --retry-connrefused -nv "$SOLR_DOWNLOAD_URL" -O "/tmp/solr.zip"; \
echo "$TYPO3_SOLR_DOWNLOAD_SHA512 /tmp/solr.zip" | sha512sum -c -; \
unzip /tmp/solr.zip -d /tmp/solr;

RUN sed -i "s|name=core_|name=website-|i" /tmp/solr/Resources/Private/Solr/cores/*/core.properties \
&& cd /tmp/solr/Resources/Private/Solr/configsets/ext_solr_11_5_0/conf \
&& for f in _schema_analysis_*_core_*.json; do mv "$f" "$(echo "$f" | sed s/core_/website-/)"; done

FROM solr:8.11.2

ENV SOLR_LOG_LEVEL=WARN \
RUN apt-get update && \
apt-get -y install wget tar && \
SOLR_DOWNLOAD_URL="https://github.com/TYPO3-Solr/ext-solr/archive/${TYPO3_SOLR}.tar.gz" && \
wget -t 10 --max-redirect 4 --retry-connrefused -nv "$SOLR_DOWNLOAD_URL" -O "/tmp/solr.tar.gz" && \
sha512sum /tmp/solr.tar.gz && \
echo "$TYPO3_SOLR_DOWNLOAD_SHA512 /tmp/solr.tar.gz" | sha512sum -c - && \
mkdir -p /tmp/solr && \
tar -zxvf /tmp/solr.tar.gz -C /tmp/solr --strip-components=1;

FROM solr:9.5.0
ENV TERM=linux \
SOLR_LOG_LEVEL=WARN \
SOLR_PORT=8983 \
HEALTHCHECK_CORE=website-generic
HEALTHCHECK_CORE=core_generic

ARG SOLR_UNIX_UID="8983"
ARG SOLR_UNIX_GID="8983"

USER root
RUN rm -fR /opt/solr/server/solr/*
RUN rm -fR /opt/solr/server/solr/* \
&& usermod --non-unique --uid "${SOLR_UNIX_UID}" solr \
&& groupmod --non-unique --gid "${SOLR_UNIX_GID}" solr \
&& chown -R solr:solr /var/solr /opt/solr \
&& apt update && apt upgrade -y && apt install sudo -y \
&& echo "# EXT:solr relevant changes: " >> /etc/default/solr.in.sh \
&& echo "SOLR_ENABLE_REMOTE_STREAMING=true" >> /etc/default/solr.in.sh \
&& echo "SOLR_ENABLE_STREAM_BODY=true" >> /etc/default/solr.in.sh \
&& echo "# END: EXT:solr" >> /etc/default/solr.in.sh

USER solr

COPY --from=builder --chown=solr:solr /tmp/solr/Resources/Private/Solr /var/solr/data
COPY --from=builder --chown=solr:solr /tmp/solr/Resources/Private/Solr/ /var/solr/data
RUN mkdir -p /var/solr/data/data

HEALTHCHECK --interval=2s --timeout=20s --retries=10 CMD curl -s -A 'healthcheck' http://localhost:$SOLR_PORT/solr/$HEALTHCHECK_CORE/admin/ping?wt=json | grep -q '"status":"OK"'

0 comments on commit a6c83f2

Please sign in to comment.