Dockerfile 1.45 KB
Newer Older
Quentin Duchemin's avatar
Quentin Duchemin committed
1
FROM alpine:3.11
2
3
4
5

# Some ENV variables
ENV PATH="/mattermost/bin:${PATH}"

Quentin Duchemin's avatar
Quentin Duchemin committed
6
# Picasoft : change these values. The team version is used by default
7
ENV MM_VERSION=5.35.0
8
9
10
11
12
13
14
15
# Get these ids with the output of `id mattermost` on the VM hosting the app
ARG PUID=5000
ARG PGID=5000

# Install some needed packages
RUN apk add --no-cache \
	ca-certificates \
	curl \
16
	jq \
17
18
19
20
21
22
23
24
25
26
27
	libc6-compat \
	libffi-dev \
  libcap \
	linux-headers \
	mailcap \
	netcat-openbsd \
	xmlsec-dev \
	tzdata \
	&& rm -rf /tmp/*

# Get Mattermost
Quentin Duchemin's avatar
Quentin Duchemin committed
28
29
RUN mkdir -p /mattermost/data /mattermost/plugins /mattermost/client/plugins \
    && curl https://releases.mattermost.com/$MM_VERSION/mattermost-team-$MM_VERSION-linux-amd64.tar.gz | tar -xz \
30
31
32
33
34
35
36
37
    && 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

#Healthcheck to make sure container is ready
38
HEALTHCHECK --interval=20s --timeout=3s CMD curl --fail http://localhost:8000//api/v4/system/ping || exit 1
39
40
41
42

# Configure entrypoint and command
COPY entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
Quentin Duchemin's avatar
Quentin Duchemin committed
43

44
45
RUN chmod +x /entrypoint.sh

46
47
USER mattermost

48
49
50
51
52
WORKDIR /mattermost
CMD ["mattermost"]

# Expose port 8000 of the container
EXPOSE 8000