mirror of
https://github.com/luzifer-docker/openfire.git
synced 2024-11-09 09:50:06 +00:00
Initial version of an Openfire container
This commit is contained in:
commit
507393fe49
2 changed files with 54 additions and 0 deletions
21
Dockerfile
Normal file
21
Dockerfile
Normal file
|
@ -0,0 +1,21 @@
|
|||
FROM alpine
|
||||
|
||||
LABEL maintainer Knut Ahlers <knut@ahlers.me>
|
||||
|
||||
ENV OPENFIRE_VERSION=4_2_1
|
||||
|
||||
RUN set -ex \
|
||||
&& apk --no-cache add curl openjdk8 ca-certificates bash \
|
||||
&& mkdir /opt \
|
||||
&& curl -sSfL "https://www.igniterealtime.org/downloadServlet?filename=openfire/openfire_${OPENFIRE_VERSION}.tar.gz" | \
|
||||
tar -xz -C /opt \
|
||||
&& curl -sSfLo /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64 \
|
||||
&& chmod +x /usr/local/bin/dumb-init
|
||||
|
||||
ADD start.sh /usr/local/bin/start.sh
|
||||
|
||||
EXPOSE 9090 9091 5222 5223 5269
|
||||
VOLUME ["/data"]
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/start.sh"]
|
||||
|
33
start.sh
Executable file
33
start.sh
Executable file
|
@ -0,0 +1,33 @@
|
|||
#!/usr/local/bin/dumb-init /bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
# init configuration
|
||||
[ -e "/data/security/keystore" ] || {
|
||||
mkdir -p /data/security
|
||||
mv /opt/openfire/resources/security/keystore /data/security/keystore
|
||||
}
|
||||
|
||||
[ -d "/data/embedded-db" ] || { mkdir -p /data/embedded-db; }
|
||||
[ -d "/data/conf" ] || { mv /opt/openfire/conf /data/conf; }
|
||||
|
||||
ln -sfn /data/security/keystore /opt/openfire/resources/security/keystore
|
||||
ln -sfn /data/embedded-db /opt/openfire/embedded-db
|
||||
rm -rf /opt/openfire/conf && ln -sfn /data/conf /opt/openfire/conf
|
||||
|
||||
# start openfire
|
||||
/opt/openfire/bin/openfire start
|
||||
|
||||
# let openfire start
|
||||
echo "Waiting for Openfire to start..."
|
||||
count=0
|
||||
while [ ! -e /opt/openfire/logs/all.log ]; do
|
||||
if [ $count -eq 60 ]; then
|
||||
echo "Error starting Openfire. Exiting"
|
||||
exit 1
|
||||
fi
|
||||
count=$(( $count + 1 ))
|
||||
sleep 1
|
||||
done
|
||||
|
||||
# tail the log
|
||||
tail -f /opt/openfire/logs/all.log
|
Loading…
Reference in a new issue