FROM alpine:3.6 # Some ENV variables ENV PATH="/mattermost/bin:${PATH}" ENV MM_VERSION=4.6.1 # Build argument to set Mattermost edition ARG edition=enterprise # Install some needed packages RUN apk add --no-cache \ ca-certificates \ curl \ jq \ libc6-compat \ libffi-dev \ linux-headers \ mailcap \ netcat-openbsd \ xmlsec-dev \ && rm -rf /tmp/* # Get Mattermost RUN mkdir -p /mattermost/data \ && if [ "$edition" = "team" ] ; then curl https://releases.mattermost.com/$MM_VERSION/mattermost-team-$MM_VERSION-linux-amd64.tar.gz | tar -xvz ; \ else curl https://releases.mattermost.com/$MM_VERSION/mattermost-$MM_VERSION-linux-amd64.tar.gz | tar -xvz ; fi \ && cp /mattermost/config/config.json /config.json.save \ && rm -rf /mattermost/config/config.json # Configure entrypoint and command COPY entrypoint.sh / ENTRYPOINT ["/entrypoint.sh"] WORKDIR /mattermost CMD ["platform"] # Expose port 80 of the container EXPOSE 80 # Use a volume for the data directory VOLUME /mattermost/data