-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
51 lines (40 loc) · 1.94 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
FROM mattermost/mattermost-prod-app:latest
RUN adduser --disabled-password --gecos "" mattermost
## install gosu
ENV GOSU_VERSION 1.9
RUN set -x \
&& apt-get update && apt-get install -y --no-install-recommends ca-certificates wget unzip python-pip && rm -rf /var/lib/apt/lists/* \
&& dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \
&& wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \
&& wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" \
&& export GNUPGHOME="$(mktemp -d)" \
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \
&& gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \
&& rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \
&& chmod +x /usr/local/bin/gosu \
&& gosu nobody true
##install dumb-init
RUN wget https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64.deb
RUN dpkg -i dumb-init_*.deb
##install consul-template
RUN wget https://releases.hashicorp.com/consul-template/0.18.0-rc2/consul-template_0.18.0-rc2_linux_amd64.zip
RUN unzip consul-template_0.18.0-rc2_linux_amd64.zip
RUN cp consul-template /bin/consul-template
RUN chmod +x /bin/consul-template
##install jq
RUN wget https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64
RUN cp jq-linux64 /bin/jq
RUN chmod +x /bin/jq
##install supervisor
RUN pip install supervisor
ADD entrypoint.sh /bin/entrypoint.sh
RUN chmod +x /bin/entrypoint.sh
ADD mattermost.sh /bin/mattermost.sh
RUN chmod +x /bin/mattermost.sh
ADD run_consul_template.sh /bin/run_consul_template.sh
RUN chmod +x /bin/run_consul_template.sh
ADD templates /templates
RUN mv /templates/supervisord.conf /usr/local/etc/supervisord.conf
RUN echo "#!/usr/bin/dumb-init /bin/bash" >/bin/reload.sh
RUN chmod +x /bin/reload.sh
ENTRYPOINT ["/bin/entrypoint.sh"]