2
0
mirror of https://github.com/processone/docker-ejabberd synced 2024-11-10 13:10:37 +00:00
docker-ejabberd/ejabberd-base/Dockerfile

56 lines
1.5 KiB
Docker
Raw Normal View History

2017-03-21 16:45:29 +00:00
FROM alpine:3.5
MAINTAINER ProcessOne <contact@process-one.net>
2017-03-21 16:45:29 +00:00
ENV REFRESHED_AT=2017-03-17 \
HOME=/home/p1 \
TERM=xterm \
LC_ALL=C.UTF-8 \
LANG=en_US.UTF-8 \
LANGUAGE=en_US.UTF-8 \
REPLACE_OS_VARS=true
# Create directory structure and user for ejabberd
2017-03-21 16:45:29 +00:00
RUN addgroup p1 -g 9000 && adduser -s /bin/bash -D -G p1 p1 -u 9000 && \
#RUN groupadd -r p1 --gid=999 && useradd -r -g p1 --uid=999 p1 && \
mkdir -p ${HOME}/ejabberd \
&& mkdir ${HOME}/cfg \
&& mkdir ${HOME}/log \
&& mkdir ${HOME}/db && \
chown -R p1:p1 ${HOME}
ENV P1DATA=${HOME}/db \
P1LOG=${HOME}/log
COPY ejabberd.yml ${HOME}/cfg/
# TODO Make it possible to define which version of Alpine we would like to use.
RUN echo \
2017-03-21 16:45:29 +00:00
&& echo "http://nl.alpinelinux.org/alpine/v3.5/main" > /etc/apk/repositories \
&& echo "http://nl.alpinelinux.org/alpine/v3.5/community" >> /etc/apk/repositories && \
apk upgrade --update musl && \
2017-03-21 16:45:29 +00:00
apk add bash su-exec libstdc++ ncurses-libs openssl expat yaml zlib sqlite && \
rm -rf /var/cache/apk/*
EXPOSE 5222 5269 5280
WORKDIR ${HOME}
COPY ejabberd.tar.gz ./
RUN tar -xzf ejabberd.tar.gz -C ${HOME}/ejabberd/ && \
chmod -R 777 ${HOME}/ejabberd && \
rm ${HOME}/ejabberd.tar.gz
# Volumes that you may want make persistent (share and backup)
VOLUME ["/home/p1/log/", "/home/p1/db/"]
WORKDIR /home/p1/ejabberd
COPY docker-entrypoint.sh /
COPY ejabberd-api /home/p1/
# CMD ./bin/ejabberd foreground
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["ejabberd"]