From 9cec10effa6c09eebabf47ac8705fbd6bfe80e16 Mon Sep 17 00:00:00 2001 From: Christophe Romain Date: Fri, 29 Dec 2017 18:33:18 +0100 Subject: [PATCH] Update mix/ecs containers --- README.md | 10 +- {ejabberd-base => ecs}/.gitignore | 0 ecs/Dockerfile | 41 + {ejabberd-base => ecs}/README.md | 0 {ejabberd-base => ecs}/build.sh | 26 +- ecs/config/cacert.pem | 3646 ++++++++++++++++++++ ecs/config/dhparams.pem | 8 + {ejabberd-base => ecs/config}/ejabberd.yml | 36 +- ecs/config/server.pem | 84 + ecs/docker-entrypoint.sh | 12 + {ejabberd-base => ecs}/ejabberd-api | Bin ecs/ejabberdctl | 329 ++ {ejabberd-base => ecs}/rel/config.exs | 0 ecs/rel/dev.exs | 10 + {ejabberd-base => ecs}/rel/docker.exs | 6 +- ejabberd-base/Dockerfile | 52 - ejabberd-base/docker-entrypoint.sh | 28 - ejabberd-base/rel/dev.exs | 10 - ejabberd-mix/Dockerfile | 18 - mix/Dockerfile | 18 + {ejabberd-mix => mix}/README.md | 0 21 files changed, 4188 insertions(+), 146 deletions(-) rename {ejabberd-base => ecs}/.gitignore (100%) create mode 100644 ecs/Dockerfile rename {ejabberd-base => ecs}/README.md (100%) rename {ejabberd-base => ecs}/build.sh (53%) create mode 100644 ecs/config/cacert.pem create mode 100644 ecs/config/dhparams.pem rename {ejabberd-base => ecs/config}/ejabberd.yml (96%) create mode 100644 ecs/config/server.pem create mode 100755 ecs/docker-entrypoint.sh rename {ejabberd-base => ecs}/ejabberd-api (100%) create mode 100755 ecs/ejabberdctl rename {ejabberd-base => ecs}/rel/config.exs (100%) create mode 100644 ecs/rel/dev.exs rename {ejabberd-base => ecs}/rel/docker.exs (50%) delete mode 100644 ejabberd-base/Dockerfile delete mode 100755 ejabberd-base/docker-entrypoint.sh delete mode 100644 ejabberd-base/rel/dev.exs delete mode 100644 ejabberd-mix/Dockerfile create mode 100644 mix/Dockerfile rename {ejabberd-mix => mix}/README.md (100%) diff --git a/README.md b/README.md index c682d21..e25b826 100644 --- a/README.md +++ b/README.md @@ -2,10 +2,10 @@ This repository contains a set of Docker images for ejabberd. -- [ejabberd/mix](https://hub.docker.com/r/ejabberd/mix/): This image allows you to build develop for ejabberd, using - all dependencies packaged from the Docker image. You do not need anything else - to build ejabberd from source and write your own ejabberd plugins. -- [ejabberd/ecs](https://hub.docker.com/r/ejabberd/ecs/): This image is build from ejabberd-base. It generates an image - suitable for running ejabberd with Docker in a simple, single-node cluster setup. +- [ejabberd/mix](https://hub.docker.com/r/ejabberd/mix/): This image allows you to build develop + environment for ejabberd, using all dependencies packaged from the Docker image. You do not + need anything else to build ejabberd from source and write your own ejabberd plugins. +- [ejabberd/ecs](https://hub.docker.com/r/ejabberd/ecs/): This image is suitable for running + ejabberd with Docker in a simple, single-node setup. Please read the README file in each repository for documentation for each image. diff --git a/ejabberd-base/.gitignore b/ecs/.gitignore similarity index 100% rename from ejabberd-base/.gitignore rename to ecs/.gitignore diff --git a/ecs/Dockerfile b/ecs/Dockerfile new file mode 100644 index 0000000..fd7ed66 --- /dev/null +++ b/ecs/Dockerfile @@ -0,0 +1,41 @@ +FROM alpine:3.7 +ARG VERSION +ENV TERM=xterm \ + LC_ALL=C.UTF-8 \ + LANG=en_US.UTF-8 \ + LANGUAGE=en_US.UTF-8 \ + REPLACE_OS_VARS=true \ + HOME=/home/ejabberd \ + VERSION=${VERSION:-latest} \ + ARCHIVE=ejabberd-${VERSION:-latest}.tar.gz +LABEL maintainer="ProcessOne " \ + product="Ejabberd Community Edition" \ + version=$VERSION + +# Create directory structure and user for ejabberd +RUN addgroup ejabberd -g 9000 && adduser -s /bin/sh -D -G ejabberd ejabberd -u 9000 \ + && mkdir -p /home/ejabberd/config /home/ejabberd/db /home/ejabberd/log \ + && chown -R ejabberd:ejabberd /home/ejabberd + +# Install required dependencies +RUN apk upgrade --update musl \ + && apk add bash libstdc++ ncurses-libs openssl expat yaml zlib sqlite curl ca-certificates \ + && rm -rf /var/cache/apk/* \ + && update-ca-certificates + +# Install ejabberd +ADD $ARCHIVE $HOME +COPY ejabberd-api $HOME/bin/ +COPY ejabberdctl $HOME/bin/ +COPY config/* $HOME/config/ +RUN chown ejabberd:ejabberd $HOME/config/* +COPY docker-entrypoint.sh / + +# Setup runtime environment +USER ejabberd +WORKDIR $HOME +VOLUME ["$HOME/db","$HOME/config","$HOME/log"] +EXPOSE 5222 5269 5280 + +ENTRYPOINT ["/docker-entrypoint.sh"] +CMD ["ejabberd"] diff --git a/ejabberd-base/README.md b/ecs/README.md similarity index 100% rename from ejabberd-base/README.md rename to ecs/README.md diff --git a/ejabberd-base/build.sh b/ecs/build.sh similarity index 53% rename from ejabberd-base/build.sh rename to ecs/build.sh index 92b0389..4cdb706 100755 --- a/ejabberd-base/build.sh +++ b/ecs/build.sh @@ -1,6 +1,9 @@ -#/bin/bash +#!/bin/bash -VERSION=17.12 +VERSION=${1:-HEAD} +REF=$VERSION +[ "$VERSION" = "HEAD" ] && VERSION=latest +ARCHIVE=ejabberd-${VERSION}.tar.gz GREEN='\033[0;32m' NC='\033[0m' # No Color]]' @@ -10,11 +13,13 @@ docker images | grep -q "ejabberd/mix" || { docker pull ejabberd/mix } -echo -e "${GREEN}Cloning ejabberd${NC}" if [ ! -d ejbuild ]; then + echo -e "${GREEN}Cloning ejabberd${NC}" git clone https://github.com/processone/ejabberd.git ejbuild +else + echo -e "${GREEN}Fetch ejabberd${NC}" + (cd ejbuild; git checkout master && git pull) fi -(cd ejbuild; git checkout master && git pull && git checkout $VERSION) cat > ejbuild/vars.config < ejbuild/vars.config <&2 + fi + ;; + *) + if [ -n "$INSTALLUSER" ] ; then + echo "ERROR: This command can only be run by root or the user $INSTALLUSER" >&2 + exit 7 + else + EXEC_CMD="as_current_user" + fi + ;; +esac + +# parse command line parameters +for arg; do + case $arg in + -n|--node) ERLANG_NODE_ARG=$2; shift;; + -s|--spool) SPOOL_DIR=$2; shift;; + -l|--logs) LOGS_DIR=$2; shift;; + -f|--config) EJABBERD_CONFIG_PATH=$2; shift;; + -c|--ctl-config) EJABBERDCTL_CONFIG_PATH=$2; shift;; + -d|--config-dir) ETC_DIR=$2; shift;; + -t|--no-timeout) NO_TIMEOUT="--no-timeout";; + --) :;; + *) break;; + esac + shift +done + +# define ejabberd variables if not already defined from the command line +: "${ETC_DIR:="$HOME_DIR/config"}" +: "${LOGS_DIR:="$HOME_DIR/log"}" +: "${EJABBERD_CONFIG_PATH:="$ETC_DIR/ejabberd.yml"}" +: "${EJABBERDCTL_CONFIG_PATH:="$ETC_DIR/ejabberdctl.cfg"}" +[ -f "$EJABBERDCTL_CONFIG_PATH" ] && . "$EJABBERDCTL_CONFIG_PATH" +[ -n "$ERLANG_NODE_ARG" ] && ERLANG_NODE="$ERLANG_NODE_ARG" +[ "$ERLANG_NODE" = "${ERLANG_NODE%.*}" ] && S="-s" +: "${EJABBERD_LOG_PATH:="$LOGS_DIR/ejabberd.log"}" +: "${SPOOL_DIR:="$HOME_DIR/database/$ERLANG_NODE"}" + +# define erl parameters +ERLANG_OPTS="+K $POLL -smp $SMP +P $ERL_PROCESSES $ERL_OPTIONS" +if [ -n "$FIREWALL_WINDOW" ] ; then + ERLANG_OPTS="$ERLANG_OPTS -kernel inet_dist_listen_min ${FIREWALL_WINDOW%-*} inet_dist_listen_max ${FIREWALL_WINDOW#*-}" +fi +if [ -n "$INET_DIST_INTERFACE" ] ; then + INET_DIST_INTERFACE2=$("$ERL" -noshell -eval 'case inet:parse_address("'$INET_DIST_INTERFACE'") of {ok,IP} -> io:format("~p",[IP]); _ -> ok end.' -s erlang halt) + if [ -n "$INET_DIST_INTERFACE2" ] ; then + ERLANG_OPTS="$ERLANG_OPTS -kernel inet_dist_use_interface $INET_DIST_INTERFACE2" + fi +fi +ERL_LIBS="$ROOT_DIR/lib" +ERL_CRASH_DUMP="$LOGS_DIR"/erl_crash_$(date "+%Y%m%d-%H%M%S").dump +ERL_INETRC="$ETC_DIR"/inetrc + +# define ejabberd parameters +EJABBERD_OPTS="$EJABBERD_OPTS\ +$(sed '/^log_rate_limit/!d;s/:[ \t]*\([0-9]*\).*/ \1/;s/^/ /' "$EJABBERD_CONFIG_PATH")\ +$(sed '/^log_rotate_size/!d;s/:[ \t]*\([0-9]*\).*/ \1/;s/^/ /' "$EJABBERD_CONFIG_PATH")\ +$(sed '/^log_rotate_count/!d;s/:[ \t]*\([0-9]*\).*/ \1/;s/^/ /' "$EJABBERD_CONFIG_PATH")\ +$(sed '/^log_rotate_date/!d;s/:[ \t]*\(.[^ ]*\).*/ \1/;s/^/ /' "$EJABBERD_CONFIG_PATH")" +[ -n "$EJABBERD_OPTS" ] && EJABBERD_OPTS="-ejabberd $EJABBERD_OPTS" +EJABBERD_OPTS="-mnesia dir \"$SPOOL_DIR\" $MNESIA_OPTIONS $EJABBERD_OPTS -s ejabberd" + +# export global variables +export EJABBERD_CONFIG_PATH +export EJABBERD_LOG_PATH +export EJABBERD_PID_PATH +export ERL_CRASH_DUMP +export ERL_EPMD_ADDRESS +export ERL_INETRC +export ERL_MAX_PORTS +export ERL_MAX_ETS_TABLES +export CONTRIB_MODULES_PATH +export CONTRIB_MODULES_CONF_DIR +export ERL_LIBS + +# export dynamic library path +case $(uname -m) in + i[3456]86) cpu="x86" ;; + i86pc) cpu="x86" ;; + armv7*) cpu="armhf" ;; + *) cpu=$(uname -m | tr A-Z a-z) ;; +esac +os=$(uname -s | tr A-Z a-z) +export LD_FALLBACK_LIBRARY_PATH="$ROOT_DIR"/lib/${os}-${cpu} +export DYLD_FALLBACK_LIBRARY_PATH="$LD_FALLBACK_LIBRARY_PATH" + +# run command either directly or via su $INSTALLUSER +exec_cmd() +{ + case $EXEC_CMD in + as_install_user) su -s /bin/sh -c '"$0" "$@"' "$INSTALLUSER" -- "$@" ;; + as_current_user) "$@" ;; + esac +} +exec_erl() +{ + NODE=$1; shift + exec_cmd "$ERL" ${S:--}name "$NODE" $ERLANG_OPTS "$@" +} +exec_iex() +{ + NODE=$1; shift + exec_cmd "$IEX" -${S:--}name "$NODE" --erl "$ERLANG_OPTS" "$@" +} + +# usage +debugwarning() +{ + if [ "$EJABBERD_BYPASS_WARNINGS" != "true" ] ; then + echo "--------------------------------------------------------------------" + echo "" + echo "IMPORTANT: we will attempt to attach an INTERACTIVE shell" + echo "to an already running ejabberd node." + echo "If an ERROR is printed, it means the connection was not successful." + echo "You can interact with the ejabberd node if you know how to use it." + echo "Please be extremely cautious with your actions," + echo "and exit immediately if you are not completely sure." + echo "" + echo "To detach this shell from ejabberd, press:" + echo " control+c, control+c" + echo "" + echo "--------------------------------------------------------------------" + echo "To bypass permanently this warning, add to ejabberdctl.cfg the line:" + echo " EJABBERD_BYPASS_WARNINGS=true" + echo "Press return to continue" + read -r input + echo "" + fi +} + +livewarning() +{ + if [ "$EJABBERD_BYPASS_WARNINGS" != "true" ] ; then + echo "--------------------------------------------------------------------" + echo "" + echo "IMPORTANT: ejabberd is going to start in LIVE (interactive) mode." + echo "All log messages will be shown in the command shell." + echo "You can interact with the ejabberd node if you know how to use it." + echo "Please be extremely cautious with your actions," + echo "and exit immediately if you are not completely sure." + echo "" + echo "To exit this LIVE mode and stop ejabberd, press:" + echo " q(). and press the Enter key" + echo "" + echo "--------------------------------------------------------------------" + echo "To bypass permanently this warning, add to ejabberdctl.cfg the line:" + echo " EJABBERD_BYPASS_WARNINGS=true" + echo "Press return to continue" + read -r input + echo "" + fi +} + +help() +{ + echo "" + echo "Commands to start an ejabberd node:" + echo " start Start an ejabberd node in server mode" + echo " debug Attach an interactive Erlang shell to a running ejabberd node" + echo " iexdebug Attach an interactive Elixir shell to a running ejabberd node" + echo " live Start an ejabberd node in live (interactive) mode" + echo " iexlive Start an ejabberd node in live (interactive) mode, within an Elixir shell" + echo " foreground Start an ejabberd node in server mode (attached)" + echo "" + echo "Optional parameters when starting an ejabberd node:" + echo " --config-dir dir Config ejabberd: $ETC_DIR" + echo " --config file Config ejabberd: $EJABBERD_CONFIG_PATH" + echo " --ctl-config file Config ejabberdctl: $EJABBERDCTL_CONFIG_PATH" + echo " --logs dir Directory for logs: $LOGS_DIR" + echo " --spool dir Database spool dir: $SPOOL_DIR" + echo " --node nodename ejabberd node name: $ERLANG_NODE" + echo "" +} + +# dynamic node name helper +uid() +{ + uuid=$(uuidgen 2>/dev/null) + [ -z "$uuid" ] && [ -f /proc/sys/kernel/random/uuid ] && uuid=$(cat /proc/sys/kernel/random/uuid) + [ -z "$uuid" ] && uuid=$(printf "%X" "${RANDOM:-$$}$(date +%M%S)") + uuid=${uuid%%-*} + [ $# -eq 0 ] && echo "${uuid}-${ERLANG_NODE}" + [ $# -eq 1 ] && echo "${uuid}-${1}-${ERLANG_NODE}" + [ $# -eq 2 ] && echo "${uuid}-${1}@${2}" +} + +# stop epmd if there is no other running node +stop_epmd() +{ + "$EPMD" -names 2>/dev/null | grep -q name || "$EPMD" -kill >/dev/null +} + +# make sure node not already running and node name unregistered +# if all ok, ensure runtime directory exists and make it current directory +check_start() +{ + "$EPMD" -names 2>/dev/null | grep -q " ${ERLANG_NODE%@*} " && { + pgrep -f "$ERLANG_NODE" >/dev/null && { + echo "ERROR: The ejabberd node '$ERLANG_NODE' is already running." + exit 4 + } + pgrep beam >/dev/null && { + echo "ERROR: The ejabberd node '$ERLANG_NODE' is registered," + echo " but no related beam process has been found." + echo "Shutdown all other erlang nodes, and call 'epmd -kill'." + exit 5 + } + "$EPMD" -kill >/dev/null + } +} + +# allow sync calls +wait_status() +{ + # args: status try delay + # return: 0 OK, 1 KO + timeout="$2" + status=4 + while [ "$status" -ne "$1" ] ; do + sleep "$3" + timeout=$((timeout - 1)) + if [ $timeout -eq 0 ] ; then + status="$1" + else + exec_erl "$(uid ctl)" -hidden -noinput -s ejabberd_ctl \ + -extra "$ERLANG_NODE" $NO_TIMEOUT status > /dev/null + status="$?" + fi + done + [ $timeout -gt 0 ] +} + +# ensure we can change current directory to SPOOL_DIR +[ -d "$SPOOL_DIR" ] || exec_cmd mkdir -p "$SPOOL_DIR" +cd "$SPOOL_DIR" || { + echo "ERROR: can not access directory $SPOOL_DIR" + exit 6 +} + +# main +case $1 in + start) + check_start + exec_erl "$ERLANG_NODE" $EJABBERD_OPTS -noinput -detached + ;; + foreground) + check_start + exec_erl "$ERLANG_NODE" $EJABBERD_OPTS -noinput + ;; + live) + livewarning + check_start + exec_erl "$ERLANG_NODE" $EJABBERD_OPTS + ;; + debug) + debugwarning + exec_erl "$(uid debug)" -hidden -remsh "$ERLANG_NODE" + ;; + etop) + exec_erl "$(uid top)" -hidden -node "$ERLANG_NODE" -s etop \ + -s erlang halt -output text + ;; + iexdebug) + debugwarning + exec_iex "$(uid debug)" --remsh "$ERLANG_NODE" + ;; + iexlive) + livewarning + exec_iex "$ERLANG_NODE" --erl "$EJABBERD_OPTS" --app ejabberd + ;; + ping) + PEER=${2:-$ERLANG_NODE} + [ "$PEER" = "${PEER%.*}" ] && PS="-s" + exec_cmd "$ERL" ${PS:--}name "$(uid ping "$(hostname $PS)")" $ERLANG_OPTS \ + -noinput -hidden -eval 'io:format("~p~n",[net_adm:ping('"'$PEER'"')])' \ + -s erlang halt -output text + ;; + started) + wait_status 0 30 2 # wait 30x2s before timeout + ;; + stopped) + wait_status 3 30 2 && stop_epmd # wait 30x2s before timeout + ;; + *) + exec_erl "$(uid ctl)" -hidden -noinput -s ejabberd_ctl \ + -extra "$ERLANG_NODE" $NO_TIMEOUT "$@" + result=$? + case $result in + 2|3) help;; + *) :;; + esac + exit $result + ;; +esac diff --git a/ejabberd-base/rel/config.exs b/ecs/rel/config.exs similarity index 100% rename from ejabberd-base/rel/config.exs rename to ecs/rel/config.exs diff --git a/ecs/rel/dev.exs b/ecs/rel/dev.exs new file mode 100644 index 0000000..0af72e1 --- /dev/null +++ b/ecs/rel/dev.exs @@ -0,0 +1,10 @@ +use Mix.Config + +# This is standard path in the context of ejabberd release +config :ejabberd, + file: "/home/p1/ejabberd/config/ejabberd.yml", + log_path: '/home/p1/ejabberd/log/ejabberd.log' + +# Customize Mnesia directory: +config :mnesia, + dir: '/home/p1/ejabberd/database/' diff --git a/ejabberd-base/rel/docker.exs b/ecs/rel/docker.exs similarity index 50% rename from ejabberd-base/rel/docker.exs rename to ecs/rel/docker.exs index 758066f..0af72e1 100644 --- a/ejabberd-base/rel/docker.exs +++ b/ecs/rel/docker.exs @@ -2,9 +2,9 @@ use Mix.Config # This is standard path in the context of ejabberd release config :ejabberd, - file: "/home/p1/cfg/ejabberd.yml", - log_path: '/home/p1/log/ejabberd.log' + file: "/home/p1/ejabberd/config/ejabberd.yml", + log_path: '/home/p1/ejabberd/log/ejabberd.log' # Customize Mnesia directory: config :mnesia, - dir: '/home/p1/db/' + dir: '/home/p1/ejabberd/database/' diff --git a/ejabberd-base/Dockerfile b/ejabberd-base/Dockerfile deleted file mode 100644 index d39e8a5..0000000 --- a/ejabberd-base/Dockerfile +++ /dev/null @@ -1,52 +0,0 @@ -FROM alpine:3.7 -MAINTAINER ProcessOne - -ENV REFRESHED_AT=2017-12-22 \ - 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 -RUN addgroup p1 -g 9000 && adduser -s /bin/bash -D -G p1 p1 -u 9000 && \ - mkdir -p ${HOME}/ejabberd ${HOME}/ejabberd/config ${HOME}/ejabberd/log ${HOME}/ejabberd/mnesiadb && \ - chown -R p1:p1 ${HOME} - -ENV P1DATA=${HOME}/ejabberd/mnesiadb \ - P1LOG=${HOME}/ejabberd/log \ - P1CFG=${HOME}/ejabberd/config - -COPY ejabberd.yml ${HOME}/ejabberd/config/ -COPY server.pem ${HOME}/ejabberd/config/ - -# TODO Make it possible to define which version of Alpine we would like to use. -#RUN echo "http://nl.alpinelinux.org/alpine/v3.6/main" > /etc/apk/repositories && \ -# echo "http://nl.alpinelinux.org/alpine/v3.6/community" >> /etc/apk/repositories && \ -RUN apk upgrade --update musl && \ - apk add bash su-exec libstdc++ ncurses-libs openssl expat yaml zlib sqlite && \ - apk add curl ca-certificates && update-ca-certificates && \ - 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/ejabberd/log/","/home/p1/ejabberd/mnesiadb/","/home/p1/ejabberd/config/"] - -WORKDIR ${HOME}/ejabberd - -COPY docker-entrypoint.sh / -COPY ejabberd-api ${HOME} - -# CMD ./bin/ejabberd foreground -ENTRYPOINT ["/docker-entrypoint.sh"] -CMD ["ejabberd"] - diff --git a/ejabberd-base/docker-entrypoint.sh b/ejabberd-base/docker-entrypoint.sh deleted file mode 100755 index 2961979..0000000 --- a/ejabberd-base/docker-entrypoint.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -set -e - -if [ "${1:0:1}" = '-' ]; then - set -- ejabberd "$@" -fi - -if [ "$1" = 'ejabberd' ]; then - mkdir -p "$P1DATA" - chmod 700 "$P1DATA" - chown -R p1 "$P1DATA" - mkdir -p "$P1LOG" - chmod 700 "$P1LOG" - chown -R p1 "$P1LOG" - - su-exec p1 $HOME/ejabberd/bin/ejabberd foreground -fi - -if [ "$1" = 'console' ]; then - mkdir -p "$P1DATA" - chmod 700 "$P1DATA" - chown -R p1 "$P1DATA" - mkdir -p "$P1LOG" - chmod 700 "$P1LOG" - chown -R p1 "$P1LOG" - - su-exec p1 $HOME/ejabberd/bin/ejabberd console -fi diff --git a/ejabberd-base/rel/dev.exs b/ejabberd-base/rel/dev.exs deleted file mode 100644 index f011e45..0000000 --- a/ejabberd-base/rel/dev.exs +++ /dev/null @@ -1,10 +0,0 @@ -use Mix.Config - -# This is standard path in the context of ejabberd release -config :ejabberd, - file: "/Users/mremond/devel/p1/ejabberd/ejabberd/config/ejabberd.yml", - log_path: '/Users/mremond/devel/p1/ejabberd/ejabberd/log/ejabberd.log' - -# Customize Mnesia directory: -config :mnesia, - dir: '/Users/mremond/devel/p1/ejabberd/ejabberd/mnesiadb/' diff --git a/ejabberd-mix/Dockerfile b/ejabberd-mix/Dockerfile deleted file mode 100644 index 7fb4993..0000000 --- a/ejabberd-mix/Dockerfile +++ /dev/null @@ -1,18 +0,0 @@ -FROM alpine:3.7 -MAINTAINER ProcessOne - -RUN apk upgrade --update musl && \ - apk add build-base git zlib-dev openssl-dev yaml-dev expat-dev sqlite-dev \ - elixir erlang-crypto erlang-eunit erlang-mnesia erlang-xmerl erlang-erts \ - erlang-tools erlang-os-mon erlang-syntax-tools erlang-parsetools \ - erlang-runtime-tools erlang-reltool && \ - rm -rf /var/cache/apk/* - -RUN mix local.hex --force && \ - mix local.rebar --force - -EXPOSE 5222 5280 - -ENTRYPOINT ["/usr/bin/mix"] - -CMD ["compile"] diff --git a/mix/Dockerfile b/mix/Dockerfile new file mode 100644 index 0000000..e3af130 --- /dev/null +++ b/mix/Dockerfile @@ -0,0 +1,18 @@ +FROM alpine:3.7 +LABEL maintainer="ProcessOne " \ + product="Ejabberd mix development environment" + +# Install required dependencies +RUN apk upgrade --update musl \ + && apk add build-base git zlib-dev openssl-dev yaml-dev expat-dev sqlite-dev \ + elixir erlang-crypto erlang-eunit erlang-mnesia erlang-xmerl erlang-erts \ + erlang-tools erlang-os-mon erlang-syntax-tools erlang-parsetools \ + erlang-runtime-tools erlang-reltool \ + && rm -rf /var/cache/apk/* + +# Setup runtime environment +RUN mix local.hex --force \ + && mix local.rebar --force + +ENTRYPOINT ["/usr/bin/mix"] +CMD ["compile"] diff --git a/ejabberd-mix/README.md b/mix/README.md similarity index 100% rename from ejabberd-mix/README.md rename to mix/README.md