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
Jason Blais 5f86258eed
Add ?src=docker-app query parameter to identify download source (#475)
#### Context:

Right now, multiple sources point to the server binaries on releases.mattermost.com, including the download page, upgrade instructions, Helm charts, version archive, and others.

We can identify the download source by adding a querystring to the url, i.e. https://releases.mattermost.com/5.22.1/mattermost-5.22.1-linux-amd64.tar.gz?src=docker-app

The intent is that we can then identify sources of downloads, identify those that typically lead to an unsuccessful server activation, and improve the experience for the developer/administrator.

This PR adds the "?src=docker-app" querysting tag to download source for the Docker app, so we know when someone downloaded it from this source

See https://github.com/mattermost/docs/pull/3596 for a similar change made to download sources on the version archive page.
2020-05-15 09:10:17 +02:00

57 lines
1.7 KiB
Docker

FROM alpine:3.10
# Some ENV variables
ENV PATH="/mattermost/bin:${PATH}"
ENV MM_VERSION=5.23.0
# Build argument to set Mattermost edition
ARG edition=enterprise
ARG PUID=2000
ARG PGID=2000
ARG MM_BINARY=
# Install some needed packages
RUN apk add --no-cache \
ca-certificates \
curl \
jq \
libc6-compat \
libffi-dev \
libcap \
linux-headers \
mailcap \
netcat-openbsd \
xmlsec-dev \
tzdata \
&& rm -rf /tmp/*
# Get Mattermost
RUN mkdir -p /mattermost/data /mattermost/plugins /mattermost/client/plugins \
&& if [ ! -z "$MM_BINARY" ]; then curl $MM_BINARY | tar -xvz ; \
elif [ "$edition" = "team" ] ; then curl https://releases.mattermost.com/$MM_VERSION/mattermost-team-$MM_VERSION-linux-amd64.tar.gz?src=docker-app | tar -xvz ; \
else curl https://releases.mattermost.com/$MM_VERSION/mattermost-$MM_VERSION-linux-amd64.tar.gz?src=docker-app | tar -xvz ; fi \
&& cp /mattermost/config/config.json /config.json.save \
&& rm -rf /mattermost/config/config.json \
&& addgroup -g ${PGID} mattermost \
&& adduser -D -u ${PUID} -G mattermost -h /mattermost -D mattermost \
&& chown -R mattermost:mattermost /mattermost /config.json.save /mattermost/plugins /mattermost/client/plugins \
&& setcap cap_net_bind_service=+ep /mattermost/bin/mattermost
USER mattermost
#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"]
# Expose port 8000 of the container
EXPOSE 8000
# Declare volumes for mount point directories
VOLUME ["/mattermost/data", "/mattermost/logs", "/mattermost/config", "/mattermost/plugins", "/mattermost/client/plugins"]