Skip to content

Commit

Permalink
fess 14.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
marevol committed Sep 5, 2022
1 parent c3e3c1d commit ff1f520
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compose/compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
fess01:
image: ghcr.io/codelibs/fess:14.3.0
image: ghcr.io/codelibs/fess:14.4.0
container_name: fess01
environment:
- "ES_HTTP_URL=http://es01:9200"
Expand Down
32 changes: 32 additions & 0 deletions fess/14.4/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM eclipse-temurin:17-jre-focal

ENV FESS_APP_TYPE docker

RUN apt-get update && \
apt-get install -y imagemagick unoconv poppler-utils && \
apt-get clean && rm -rf /var/lib/apt/lists/*

ARG FESS_VERSION=14.4.0

RUN groupadd -g 1001 fess && \
useradd -u 1001 -g fess --system --no-create-home --home /var/lib/fess fess

ARG CACHEBUST=1
RUN set -x && \
curl -LfsSo /tmp/fess-${FESS_VERSION}.deb \
https://github.com/codelibs/fess/releases/download/fess-${FESS_VERSION}/fess-${FESS_VERSION}.deb && \
dpkg -i /tmp/fess-${FESS_VERSION}.deb && \
rm -rf /tmp/fess-${FESS_VERSION}.deb && \
mkdir /opt/fess && \
chown -R fess.fess /opt/fess && \
sed -i -e 's#FESS_CLASSPATH="$FESS_CONF_PATH:$FESS_CLASSPATH"#FESS_CLASSPATH="$FESS_OVERRIDE_CONF_PATH:$FESS_CONF_PATH:$FESS_CLASSPATH"#g' /usr/share/fess/bin/fess && \
echo "export FESS_APP_TYPE=$FESS_APP_TYPE" >> /usr/share/fess/bin/fess.in.sh && \
echo "export FESS_OVERRIDE_CONF_PATH=/opt/fess" >> /usr/share/fess/bin/fess.in.sh && \
apt-get clean && rm -rf /var/lib/apt/lists/*

WORKDIR /usr/share/fess
EXPOSE 8080

USER root
COPY run.sh /usr/share/fess/run.sh
ENTRYPOINT /usr/share/fess/run.sh
82 changes: 82 additions & 0 deletions fess/14.4/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
#!/bin/bash

if [[ "x${FESS_DICTIONARY_PATH}" != "x" ]] ; then
sed -i -e "s|^FESS_DICTIONARY_PATH=.*|FESS_DICTIONARY_PATH=${FESS_DICTIONARY_PATH}|" /etc/default/fess
fi

if [[ "x${ES_HTTP_URL}" = "x" ]] ; then
ES_HTTP_URL=http://localhost:9200
else
sed -i -e "s|^ES_HTTP_URL=.*|ES_HTTP_URL=${ES_HTTP_URL}|" /etc/default/fess
fi

if [[ "x${ES_TYPE}" != "x" ]] ; then
FESS_JAVA_OPTS="${FESS_JAVA_OPTS} -Dfess.config.elasticsearch.type=${ES_TYPE}"
fi

if [[ "x${ES_USERNAME}" != "x" ]] ; then
FESS_JAVA_OPTS="${FESS_JAVA_OPTS} -Dfess.config.elasticsearch.username=${ES_USERNAME}"
fi

if [[ "x${ES_PASSWORD}" != "x" ]] ; then
FESS_JAVA_OPTS="${FESS_JAVA_OPTS} -Dfess.config.elasticsearch.password=${ES_PASSWORD}"
fi

if [[ "x${FESS_JAVA_OPTS}" != "x" ]] ; then
echo "FESS_JAVA_OPTS=\"${FESS_JAVA_OPTS}\"" >> /etc/default/fess
fi

if [[ "x${PING_RETRIES}" = "x" ]] ; then
PING_RETRIES=3
fi

if [[ "x${PING_INTERVAL}" = "x" ]] ; then
PING_INTERVAL=60
fi

start_fess() {
ln -s /opt/java/openjdk/bin/java /usr/bin/java
touch /var/log/fess/fess-crawler.log \
/var/log/fess/fess-suggest.log \
/var/log/fess/fess-thumbnail.log \
/var/log/fess/fess-urls.log \
/var/log/fess/audit.log \
/var/log/fess/fess.log
chown fess:fess /var/log/fess/fess-crawler.log \
/var/log/fess/fess-suggest.log \
/var/log/fess/fess-thumbnail.log \
/var/log/fess/fess-urls.log \
/var/log/fess/audit.log \
/var/log/fess/fess.log
tail -f /var/log/fess/*.log &
/etc/init.d/fess start
}

wait_app() {
if [[ "x${FESS_CONTEXT_PATH}" = "x" ]] ; then
ping_path=/json/ping
else
ping_path=${FESS_CONTEXT_PATH}/json/ping
fi
while true ; do
status=$(curl -w '%{http_code}\n' -s -o /dev/null "http://localhost:8080${ping_path}")
if [[ x"${status}" = x200 ]] ; then
error_count=0
else
error_count=$((error_count + 1))
fi
if [[ ${error_count} -ge ${PING_RETRIES} ]] ; then
echo "Fess is not available."
exit 1
fi
sleep ${PING_INTERVAL}
done
}

start_fess

if [[ "x${RUN_SHELL}" = "xtrue" ]] ; then
/bin/bash
else
wait_app
fi

0 comments on commit ff1f520

Please sign in to comment.