Skip to content

Commit

Permalink
Release 8.2.2; #server-1348
Browse files Browse the repository at this point in the history
  • Loading branch information
woj-tek committed Apr 3, 2023
1 parent a753d6e commit cd87ff9
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 1 deletion.
42 changes: 42 additions & 0 deletions 8.2.2/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
FROM openjdk:11-jre-slim
MAINTAINER "Tigase, Inc." <support@tigase.net>

# Create directory structure, download Tigase XMPP Server -dist-max package and unpack it
# At the same time remove setting JAVA_HOME from etc/tigase.conf as variable is already set
# Then move content of etc/ directory to etc.orig/ to be able to use volume to host configuration.
# Additionally we are removing docs/ and downloaded package to reduce size.
ARG TYPE=""
ENV TYPE ${TYPE}

RUN mkdir /home/tigase \
&& cd /home/tigase \
&& apt-get update \
&& apt-get install -y --no-install-recommends wget curl \
&& wget -nv https://github.com/tigase/tigase-server/releases/download/tigase-server-8.2.2/tigase-server-8.2.2-b11697-dist${TYPE}.tar.gz \
&& apt-get remove -y wget \
&& rm -rf /var/lib/apt/lists/* \
&& tar -zxf tigase-server-8.2.2-b11697-dist${TYPE}.tar.gz \
&& ln -s `find . -name 'tigase-server-*' -maxdepth 1 -type d` tigase-server \
&& rm -rf tigase-server/docs/ \
&& rm -rf tigase-server-8.2.2-b11697-dist${TYPE}.tar.gz \
&& sed -i -e 's/JAVA_HOME/#JAVA_HOME/' tigase-server/etc/tigase.conf \
&& mv tigase-server/etc tigase-server/etc.orig

# Add statup scripts and make them executable
# We need custom scripts to make sure that database is upgraded
# and that Tigase will NOT be launched as background service!
ADD scripts/start.sh /start.sh
RUN chmod 755 /start.sh

# Set TIGASE_HOME variable
ENV TIGASE_HOME /home/tigase/tigase-server

# Set ports of the container which can be exposed
EXPOSE 5222 5223 5269 5277 5280 5281 5290 5291 8080 9050 9070

# Set possible volume (directories which can be mounted from the docker host machine)
# like etc/, conf/, certs/, logs/, data/
VOLUME ["/home/tigase/tigase-server/etc", "/home/tigase/tigase-server/conf", "/home/tigase/tigase-server/certs", "/home/tigase/tigase-server/logs", "/home/tigase/tigase-server/data"]

# Define script which should be executed on container startup
CMD ["/bin/bash", "/start.sh"]
33 changes: 33 additions & 0 deletions 8.2.2/scripts/start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/bin/bash

if [[ ! -z "$COPY_CONFIG_SRC" ]]; then
echo "Copying config from $COPY_CONFIG_SRC ..."
cp -L -r -n -v "$COPY_CONFIG_SRC/config.tdsl" /home/tigase/tigase-server/etc
echo "--------------------------------------"
fi

cp -r -n /home/tigase/tigase-server/etc.orig/* /home/tigase/tigase-server/etc/

echo "Checking if database is already available: ${DB_HOST}:${DB_PORT}";
if [ -n "${DB_HOST}" ] && [ -n "${DB_PORT}" ] ; then
/home/tigase/tigase-server/scripts/wait-for-it.sh "${DB_HOST}":"${DB_PORT}" -t 30
fi
if grep -q "config-type.*setup" "/home/tigase/tigase-server/etc/config.tdsl" ; then
echo "Running in setup mode, skipping schema upgrade...";
else
echo "Upgrading database schema...";
ADDITIONAL_PARAMS=""
if [[ ! -z "$ADMIN_JID" && ! -z "$ADMIN_PASSWORD" ]]; then
ADDITIONAL_PARAMS="$ADDITIONAL_PARAMS --adminJID=\"$ADMIN_JID\" --adminJIDpass=\"$ADMIN_PASSWORD\"";
fi
if [[ ! -z "$DB_ROOT_USER" && ! -z "$DB_ROOT_PASS" ]]; then
ADDITIONAL_PARAMS="$ADDITIONAL_PARAMS -R \"${DB_ROOT_USER}\" -A \"${DB_ROOT_PASS}\"";
fi
if [[ ! -z "$DB_LOG_LEVEL" ]]; then
ADDITIONAL_PARAMS="$ADDITIONAL_PARAMS -L \"${DB_LOG_LEVEL}\"";
fi
/home/tigase/tigase-server/scripts/tigase.sh upgrade-schema /home/tigase/tigase-server/etc/tigase.conf "$ADDITIONAL_PARAMS"
fi

echo "Starting Tigase XMPP Server...";
/home/tigase/tigase-server/scripts/tigase.sh run /home/tigase/tigase-server/etc/tigase.conf
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ done
2) Newer versions with multiple types -- currently only `nightly` version but after releasing more version each subsequent version should be added to the list
```bash
for TYPE in "" "-enterprise" ; do
for VERSION in 8.2.0 8.2.1 8.3.0 nightly ; do
for VERSION in 8.2.0 8.2.1 8.2.2 8.3.0 nightly ; do
docker buildx build --platform linux/amd64,linux/arm64 --build-arg TYPE=${TYPE} -t tigase/tigase-xmpp-server:${VERSION}${TYPE} -f ${VERSION}/Dockerfile --no-cache ${VERSION}/ --push
done
done
Expand Down

0 comments on commit cd87ff9

Please sign in to comment.