This repository has been archived on 2021-08-31. You can view files and clone it, but cannot push or open issues or pull requests.
mattermost/app/Dockerfile

52 lines
1.4 KiB
Docker
Raw Normal View History

2018-02-09 00:55:45 +01:00
FROM alpine:3.6
# Some ENV variables
ENV PATH="/mattermost/bin:${PATH}"
2018-08-24 14:35:11 +02:00
ENV MM_VERSION=5.2.1
# Build argument to set Mattermost edition
2017-11-26 19:58:56 +01:00
ARG edition=enterprise
2018-04-15 19:33:49 +02:00
ARG PUID=2000
ARG PGID=2000
# Install some needed packages
2018-02-09 00:55:45 +01:00
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 \
&& addgroup -g ${PGID} mattermost \
2018-04-15 19:33:49 +02:00
&& adduser -D -u ${PUID} -G mattermost -h /mattermost -D mattermost \
2018-08-24 14:35:11 +02:00
&& chown -R mattermost:mattermost /mattermost /config.json.save
2018-04-15 19:33:49 +02:00
2018-08-24 14:35:11 +02:00
USER mattermost
2018-04-15 19:33:49 +02:00
#Healthcheck to make sure container is ready
HEALTHCHECK CMD curl --fail http://localhost:8000 || exit 1
# Configure entrypoint and command
COPY entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
WORKDIR /mattermost
CMD ["mattermost"]
2018-04-15 19:33:49 +02:00
# Expose port 8000 of the container
EXPOSE 8000
2018-04-15 19:33:49 +02:00
# Declare volumes for mount point directories
2018-08-22 14:47:58 +02:00
VOLUME ["/mattermost/data", "/mattermost/logs", "/mattermost/config", "/mattermost/plugins"]