-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile
42 lines (36 loc) · 2.11 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
FROM openjdk:8-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
# and add additional parameters to GC variable to make Java aware of Docker limits
# 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.
RUN mkdir /home/tigase \
&& cd /home/tigase \
&& apt-get update \
&& apt-get install -y --no-install-recommends wget \
&& wget https://github.com/tigase/tigase-server/releases/download/tigase-server-8.0.0/tigase-server-8.0.0-b10083-dist-max.tar.gz \
&& apt-get remove -y wget \
&& rm -rf /var/lib/apt/lists/* \
&& tar -zxvf tigase-server-8.0.0-b10083-dist-max.tar.gz \
&& ln -s `find . -name 'tigase-server-*' -maxdepth 1 -type d` tigase-server \
&& rm -rf tigase-server/docs/ \
&& rm -rf tigase-server-8.0.0-b10083-dist-max.tar.gz \
&& sed -i -e 's/JAVA_HOME/#JAVA_HOME/;/^JAVA_METASPACE=.*/a \\nGC="${GC} -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap "\n' 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
ADD scripts/tigase.sh /tigase.sh
RUN chmod 755 /start.sh
RUN chmod 755 /tigase.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"]