Compare commits

..

142 Commits

Author SHA1 Message Date
voima-eetu
c3ecd245be
Change nginx container to unprivileged (#525) 2021-05-05 09:05:09 +02:00
Sven Hüster
5b52f713bd
Add warning to README (#530)
* Update README.md

* Update README.md

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update README.md

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

* Update README.md

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>

Co-authored-by: Carrie Warner (Mattermost) <74422101+cwarnermm@users.noreply.github.com>
2021-03-30 14:42:55 +02:00
Patrick Schratz
d8c52f8d74
Make MM_VERSION an ARG instead of an ENV (#515)
* make MM_VERSION an ARG instead of an ENV
2021-03-21 10:17:41 +01:00
Amy Blais
2b12534f90
Update Dockerfile (#511) 2021-01-15 15:52:40 +01:00
wf6DJd8a3xSSCZbn
6f8c34c0f3
Updating shell scripts to adhear better to Bash style guides (#510)
* Updated Shell Script Format

Signed-off-by: Spencer <wf6DJd8a3xSSCZbn@protonmail.com>
2021-01-08 16:45:00 +01:00
Amy Blais
ad76445269
Update Dockerfile (#508) 2020-12-23 01:25:04 +01:00
Dave Thompson
bb1e8066c4
Enable easy configuration of encrypted PostgreSQL connections with new optional DB_SSLMODE (defaults to current value of "disable") following values allowed by PostgreSQL (#506)
* change to support environment variable configuration of SSL mode for PostgreSQL connections
2020-12-10 15:02:24 +01:00
Carlos Panato
43501880ff
bump to use 5.29.1 release 2020-12-04 16:35:55 +01:00
Yannic Haupenthal
a758c2c52b
Consistency of app/* (#502)
* be consistent with the use of tabs

* tabs; shellcheck; consistency

* use tabs
* use shellcheck to fix non POSIX stuff
* be consistent with the use of quotes and if-then-else / for-do-done
2020-11-17 12:05:16 +01:00
Carlos Panato
7647cce8c1
update MM to 5.29.0 2020-11-16 13:19:28 +01:00
Simon Staszkiewicz
c8b5a40f99
Update SSL ciphers and TLS versions in nginx config file (#501) 2020-11-03 10:12:21 +01:00
Carlos Panato
124a8ba340
Merge remote-tracking branch 'upstream/master' into master 2020-10-20 09:10:29 +02:00
Carlos Panato
8d916d82fa
bump based release 2020-10-20 09:09:12 +02:00
Elisabeth Kulzer
1f5c1b24f1
DOPS-215: Add MM_INSTALL_TYPE environment variable. (#497) 2020-10-07 14:06:26 +02:00
Emanuele Panzeri
66ab03e4fe
Quote arguments (#492) 2020-09-18 11:12:40 +02:00
Carlos Panato
bccdcd527d
update MM to 5.27.0 2020-09-14 17:24:16 +02:00
Carlos Panato
689a8f88db
bump MM to 5.26.1 2020-08-27 08:04:39 +02:00
Carlos Panato
6a4ab2bd12
bump MM to 5.26.0 2020-08-12 23:11:56 +02:00
nvjacobo
7c80c1fdb5
add TLS 1.3 support to web container (#488) 2020-08-10 10:56:21 +02:00
Carlos Panato
85375bfcfd
bump mm to 5.25.2 2020-08-04 15:00:13 +02:00
Carlos Panato
8553ee32aa
update MM to 5.25.1 2020-07-24 16:14:01 +02:00
Francois-D
9eb10f5cf3
Remove sudo: required as it is deprecated. (#485)
Co-authored-by: francois-d <dfrancis2.primus.ca>
2020-07-21 08:52:04 +02:00
Carlos Panato
189bc354fe
bump MM to 5.25.0 2020-07-15 19:03:29 +02:00
Carlos Panato
0f0612f484
bump to 5.24.2 2020-06-29 17:35:50 +02:00
Carlos Panato
0d5ff88269
bump MM to 5.24.1 2020-06-23 11:06:21 +02:00
Carlos Panato
8a288119d9
bump MM to 5.24.0 2020-06-18 14:23:46 +02:00
Amy Blais
8f81794e44
Update Dockerfile (#476) 2020-06-05 14:59:33 +02:00
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
Carlos Panato
6ba3e35ea0
bump docker app to 5.23.0 2020-05-14 17:49:53 +02:00
craph
50921a7313
Fix : certificate signed by unknown authority refs : https://github.com/mattermost/mattermost-server/issues/13059 (#474) 2020-05-13 17:17:48 +02:00
Carlos Panato
4f0087ebac
bump app dockerfile to 5.22.3 2020-05-12 08:17:17 +02:00
Oliver
a685cc24e5
Fixing docker-compose build process (#471)
Currently the command `docker-compose build` throws an error for building the database because it uses an old pip version.

This PR updates pip right before it is called. Anyways this should just be a temporary fix because the image uses Python 2.7 wich out of support since Jan 2020
2020-04-28 09:57:15 +02:00
Carlos Panato
8e796ba46e
bump mm to 5.22.1 2020-04-25 10:45:34 +02:00
Sven Hüster
69169f73ee
Update Dockerfile (#467) 2020-04-21 14:45:49 +02:00
nvjacobo
7fd2eb47a9
docker-compose: fix DB Docker building error #463 related wal-e 1.0.0 and azure (#464) 2020-04-15 09:30:49 +02:00
Igor Serebryany
1bfa69db5c
allow uncommenting for team edition (#433)
currently, if you follow the instructions and uncomment the lines, you
will get a YAML error:

```
ERROR: yaml.parser.ParserError: while parsing a block mapping
  in "./docker-compose.yml", line 23, column 5
expected <block end>, but found '<block mapping start>'
  in "./docker-compose.yml", line 25, column 7
```

found the potential solution in mattermost/mattermost-docker#343

Co-authored-by: mattermod <mattermod@users.noreply.github.com>
2020-04-01 11:46:36 +02:00
Akendo
068e654249
Fix the linking of the nginx configuration file (#458)
In this commit I'm adding some logic to ensure that the `entrypoint.sh`
file handles a pre-existing `mattermost.conf` file within the nginx
folder.

During deployment of some more custom nginx configuration it was
noticed that the linking process fails, because a file already exists
with the filesystem.

Signed-off-by: Akendo <akendo@akendo.eu>
2020-04-01 11:32:05 +02:00
alessandro
b4482771f7
docker-compose: remove unused ENV variable (#456) 2020-03-26 13:53:10 +01:00
Carlos Panato
ed682904c0
bump mm prod app to 5.21.0 2020-03-13 14:07:29 +01:00
Carlos Panato
e56bfe8a35
bump mm prod app to 5.20.2 2020-03-13 09:59:37 +01:00
alessandro
07b368de41
web entrypoint: forcefully link existing config (#454) 2020-03-13 09:58:26 +01:00
Claas Augner
1427315ef9
Remove deprecated nginx ssl directive (#451) (#452) 2020-03-03 14:30:03 +01:00
Carlos Panato
492ecd5ca3
bump mm prod app to 5.20.1 2020-02-17 09:57:28 +01:00
Carlos Panato
87fd37fc6f
bump mm prod app to 5.20.0 2020-02-15 10:13:58 +01:00
Carlos Panato
0f5428aa0d
bump to 5.19.1 2020-02-12 14:08:59 +01:00
Kevin Kandlbinder
8c8894ea15
Update Dockerfile (#448)
Closes #446.
2020-02-07 10:53:12 +01:00
Joshua Rosenfeld
58f972034d bump to 5.19.0 (#444) 2020-01-21 16:52:42 +01:00
Marc Becker
4075f0f922 Installing missing package pv (#443)
I tried to use wal-e as mentioned on dockerhub (see https://hub.docker.com/r/mattermost/mattermost-prod-db). To do the base backup I had to do some additional steps (see https://github.com/mattermost/mattermost-docker/issues/346):
- mount a volume into the database docker container (path in the container is /etc/wal-e.d/env) and put all credentials and the s3 prefix to this folder
- exec into the container and create a superuser (Command: CREATE USER postgres SUPERUSER;)

Now it still fails with the message, that the package *pv* is missing
2020-01-14 18:25:53 +01:00
Joshua Rosenfeld
a5d81c43fc bump to 5.18.1 (#441) 2020-01-09 19:23:19 +01:00
Raju Devidas
c3916bb1c3 Fixes for the smooth deployment of Team edition. (#438)
* Fixes for the smooth deployment of Team edition.
	- Just uncommenting out the lines does not work as expected.
	- the line for context is required for it to work for team edition deployment.
	- Added the subsequent changes in the installation instructions in README.md

* Adding changes as suggested by @ccoenen
  - making the changes more clear in the code block
  - adding more textual clarity in the sentence on what needs to be changed.
2020-01-09 11:24:03 +01:00
Carlos Panato
b9484f4444
bump to 5.18.0 2019-12-17 13:10:46 +01:00
Simon Staszkiewicz
39e9023691 Bug fixes (#427)
* Call the base container entrypoint with proper arguments

* Build the app container using path to directory

* Add CONTRIBUTING.md
2019-11-29 16:25:20 +01:00
Carlos Panato
ec1908a2ae
bump to 5.17.1 2019-11-25 18:58:05 +01:00
Carlos Panato
13d461d909
bump to 5.17.0 2019-11-21 14:23:17 +01:00
Ventz Petkov
4f4302fe1b Fix for letsencrypt, where to run on 443 you need to setcap cap_net_bind_service=+ep ./bin/mattermost. Note, this is needed internally from the container even if you set the correct CAP_NET_BIND_SERVICE in the docker compose env (#425) 2019-11-11 13:22:06 +01:00
Carlos Panato
3bc888ac7d
bump to 5.16.3 2019-11-07 08:19:16 +01:00
Christopher Poile
8dfd06db9d save the sql datasource into an env variable in the app container (#421) 2019-11-06 14:59:16 +01:00
Carlos Panato
425fcce148
bump to 5.16.2 2019-10-30 18:12:44 +01:00
Carlos Panato
79c50a1fa1
bump to 5.16.1 2019-10-30 07:28:40 +01:00
Carlos Panato
59a20bd83e
bump to 5.16.0 2019-10-18 14:40:02 +02:00
Carlos Panato
65c4244ba6
bump to 5.15.1 2019-10-14 14:08:43 +02:00
Carlos Panato
95d45e75fd
bump to 5.15.0 2019-09-17 09:12:01 +02:00
Carlos Panato
317ec67f2c
bump to 5.14.3 2019-09-17 09:10:34 +02:00
Marco Blessing
29c49db492 update docker-compose version (#415)
* update docker-compose version

* updating to file version 3 shouldn't break anything
2019-09-16 17:40:23 +02:00
Carlos Panato
ed9fed6916
add empty circleci 2019-09-09 12:11:50 +02:00
Kyle Robbertze
5b37c5ff53 Kubernetes Fixes (#413)
* Fix mattermost port number

* Bump version number

* Fix DB_PORT_NUMBER env variable

* List permissions required on data persistentvolume
2019-09-09 11:56:10 +02:00
Carlos Alberto Schneider Júnior
f807181245 bump mm version to 5.14.2 (#412) 2019-09-09 11:53:57 +02:00
Carlos Panato
a315bc042d
bump mm version 2019-08-29 11:24:45 +02:00
Carlos Panato
3a00bbc381
bump mattermost 2019-08-17 11:37:38 +02:00
Carlos Panato
c1dea8605b
update alpine base image 2019-08-17 11:37:30 +02:00
Kyâne Pichou
e755b5eb85 Remove @pichouk from active maintainers (#406) 2019-08-15 16:56:14 +02:00
Carlos Panato
4129a0e804
bump to 5.13.2 2019-07-29 15:31:47 +02:00
Carlos Panato
91701c543d
bump to 5.13.1 2019-07-19 21:35:00 +02:00
Carlos Panato
a46068e305
bump dockerfile to use 5.13.0 2019-07-17 10:42:12 +02:00
Carlos Panato
77ac551419
bump to 5.12.4 2019-07-16 11:35:53 +02:00
Carlos Panato
668f3bfb04
bump mm version in master as well 2019-06-28 11:25:44 +02:00
Carlos Tadeu Panato Junior
801eb4435c
bump to 5.12.0 (#396) 2019-06-15 11:38:32 +02:00
Carlos Tadeu Panato Junior
548091ebd8
bump to 5.11.0 (#393) 2019-05-16 09:44:06 +02:00
redg3ar
1893b95e8a fix typo in readme (#391) 2019-05-15 20:40:19 +02:00
Kyâne Pichou
e5ae4eb1e2 Revert "update readme to add deprecation notice (#388)" (#389)
This reverts commit 65acc9ac54.
2019-05-06 17:08:58 +02:00
scott lee davis
11f233e6b1 include timezone for plugins that use location information. (#390) 2019-05-05 20:50:58 +02:00
Carlos Tadeu Panato Junior
65acc9ac54 update readme to add deprecation notice (#388) 2019-05-03 21:21:34 +02:00
Carlos Tadeu Panato Junior
a7d6eb540f
Merge pull request #384 from cpanato/5.10
update to 5.10.0
2019-04-17 10:29:21 +02:00
Carlos Panato
2522c9c0cd
update to 5.10.0 2019-04-17 10:17:51 +02:00
Carlos Tadeu Panato Junior
cb6690b5f8
Merge pull request #379 from cpanato/5.9.0
bump to use 5.9.0
2019-03-16 10:50:23 +01:00
Carlos Panato
a62aa728ae
bump to use 5.9.0 2019-03-16 10:33:45 +01:00
Carlos Tadeu Panato Junior
201cca1a66
Merge pull request #380 from cpanato/5.8.1
bump to 5.8.1
2019-03-16 10:27:39 +01:00
Carlos Panato
32c53cb7ba
bump to 5.8.1 2019-03-16 10:06:10 +01:00
Carlos Tadeu Panato Junior
d538ee0f0a
Merge pull request #370 from tejasbubane/upgrades
Upgrade alpine to 3.9
2019-03-12 09:33:08 +01:00
Tejas Bubane
9037a92cfb
Upgrade app alpine image to 3.9 2019-03-12 13:10:06 +05:30
Carlos Tadeu Panato Junior
25f7109bc6
Merge pull request #374 from mattermost/change-maintainers
Update maintainers
2019-02-22 15:07:49 +01:00
Kyâne
53ab78d245 Add Carlos Panato as maintainer 2019-02-21 20:27:52 +01:00
Kyâne
ab63404929 Move Pan Luo as previous maintainer 2019-02-21 20:27:35 +01:00
Carlos Tadeu Panato Junior
b95ad214ff
Merge pull request #372 from cpanato/5.8.0
update MM to 5.8.0
2019-02-16 11:18:51 +01:00
Carlos Panato
fa60edeb94
update MM to 5.8.0 2019-02-16 10:57:15 +01:00
Carlos Tadeu Panato Junior
fab23ca3ff
Merge pull request #371 from cpanato/5.7.2
update MM to 5.7.2
2019-02-16 10:54:37 +01:00
Carlos Panato
dd8850f5c5
update MM to 5.7.2 2019-02-16 10:46:59 +01:00
Carlos Tadeu Panato Junior
52fd23b846
Merge pull request #367 from mattermost/change-log-settings
Enable error log to Console by default
2019-02-11 10:06:08 +01:00
Kyâne
bcbfc6a04b Enable error log to Console by default
Closes #365
2019-02-09 19:47:44 +01:00
Kyâne Pichou
738d7b6353
Upgrade to 5.7.1 (#358)
Closes #357
2019-02-01 21:40:01 +01:00
Carlos Tadeu Panato Junior
d3f9a7dec2
Merge pull request #359 from Ovski4/patch-1
Break traefik command in multiple lines
2019-01-29 11:47:18 +01:00
Baptiste Bouchereau
f701af7044
Update docker-stack-traefik.yml
The command is pretty long. I used yaml folded style:
- Each line break is replaced by a space.
- The indention in each line will be ignored
- A line break will be inserted at the end.
Which keep the current behaviour
2019-01-29 21:04:07 +13:00
cpanato
defa175421
update to 5.7.0 2019-01-16 01:39:38 -04:00
cpanato
fc50e8de8b
bump to 5.6.3 2019-01-12 18:39:33 +01:00
Carlos Tadeu Panato Junior
bdc89c926a
Merge pull request #355 from cpanato/update_bean
add config.json to elasticbeanstalk deployment
2019-01-12 16:17:04 +01:00
Kyâne
d8d6ac96bf Add client plugins as bind mount
Closes #356
2019-01-11 19:21:57 +01:00
cpanato
4ccecdd0bd
add config 2019-01-07 11:55:10 +01:00
Carlos Tadeu Panato Junior
4f80ede8bb
Merge pull request #353 from cpanato/bump562
bump to 5.6.2
2018-12-22 16:37:22 +01:00
cpanato
79ae72ec6c
bump to 5.6.2 2018-12-22 15:59:43 +01:00
Carlos Tadeu Panato Junior
c58467c507
Merge pull request #351 from cpanato/bump561
bump to 5.6.1
2018-12-19 23:32:34 +01:00
cpanato
470efcc185
bump to 5.6.1 2018-12-19 23:02:30 +01:00
Carlos Tadeu Panato Junior
2992a9eb70
Merge pull request #350 from cpanato/bump_560
bump to version 5.6.0
2018-12-14 22:29:15 +01:00
cpanato
af5d1dcd3f
bump to version 5.6.0 2018-12-14 22:03:03 +01:00
Kyâne
dd1ecde9c8 Allow to properly shutdown web container
Closes #347
2018-12-14 19:56:30 +01:00
Carlos Tadeu Panato Junior
84fdd0d081
Merge pull request #344 from cpanato/5.5.1
bump to 5.5.1
2018-12-06 11:42:50 +01:00
cpanato
0ef663ca4d
bump to 5.5.1 2018-12-06 11:07:56 +01:00
Schrooms
2efe681682 renamed the vars to be better inline with the readme (#341) 2018-12-04 20:29:02 +01:00
Carlos Tadeu Panato Junior
8516ea1ee9
Merge pull request #338 from cpanato/5.5.0
Bump to 5.5.0
2018-11-15 20:18:11 +01:00
cpanato
b0ad6fc932
Bump to 5.5.0 2018-11-15 20:12:44 +01:00
Carlos Tadeu Panato Junior
026c2bcf49 downgrade alpine to 3.7 due xmlsec1 issues (#334) 2018-11-03 15:27:47 +01:00
Kyâne Pichou
68db80f759
Improve app to db connection setup (#332) 2018-10-29 13:57:59 +01:00
Victor Yang
3ff54bc90f fix S3 wal-e support (#324)
* fix S3 wal-e support
2018-10-29 12:00:20 +01:00
gy741
f49e4894cc fix uuoc and typo (#333)
* Fix typo

* Fix UUOC in app/entrypoint.sh
2018-10-27 17:13:32 +02:00
Carlos Tadeu Panato Junior
647ca3e8c6 fix permission in plugin folder (#331) 2018-10-19 16:08:09 +02:00
Kyâne Pichou
94c09b61a0
Fix database HEALTHCHECK with correct user/db name (#330)
Closes #325
2018-10-17 20:30:46 +02:00
Kyâne Pichou
ec683530be
Upgrade to 5.4.0 (#327) 2018-10-16 20:50:18 +02:00
Kyâne Pichou
e01e8e4c01
Fix typo (#323)
Thanks @adam-golab for the report (#320)
2018-10-05 21:19:39 +02:00
Kyâne Pichou
908ab3c22b
Add warning about read_only (#321)
Closes #317
2018-10-05 16:51:13 +02:00
Kyâne Pichou
42e8e07c3f
Fix database healthcheck (#318)
Because the PostgreSQL user is not always "postgres", do not specify a
user to the Healthcheck command. It will also works correctly.

Closes #313
2018-10-04 09:32:02 +02:00
Carlos Tadeu Panato Junior
e6deb77cbe Remove DB check in the app/entrypoint (#316)
* fix check

* remove db check
2018-10-02 11:53:08 +02:00
Carlos Tadeu Panato Junior
8adcd9e53b if all config was set in the config.json bypass the checks (#315) 2018-09-28 20:24:42 +02:00
Carlos Tadeu Panato Junior
1604e11a5b add ability to build your own mm binary (#314) 2018-09-28 15:01:06 +02:00
Carlos Tadeu Panato Junior
ddbc3cc81b add volume for client/plugins (#312) 2018-09-23 20:02:06 +02:00
Pierre Kuhner
788cb9f641 Bump to MM 5.3.1 (#310) 2018-09-19 10:24:20 +02:00
Carlos Tadeu Panato Junior
f6744c052d Bump to 5.3.0 (#308) 2018-09-14 20:47:35 +02:00
PICHOU Kyâne
a92d3e91a8 Bump to 5.2.2
Close #307
2018-09-14 20:37:51 +02:00
Tejas Bubane
52739026c8 Use alpine image v3.8 for app container (#305)
Closes #304
2018-09-10 21:07:45 +02:00
dcherniv
17b9055ed6 Collapsing RUNs to save space by combining layers (#301) 2018-08-27 22:25:41 +02:00
Carlos Tadeu Panato Junior
83ed83237d
Merge pull request #298 from cpanato/5.2.1
Bump to 5.2.1
2018-08-24 14:50:46 +02:00
cpanato
947d278973
Bump to 5.2.1 2018-08-24 14:35:11 +02:00
cpanato
776169b16b
remove spaces 2018-08-24 14:35:01 +02:00
Yusuke Nemoto
1811af4a75 Backup plugins directory (#297) 2018-08-22 14:47:58 +02:00
24 changed files with 699 additions and 168 deletions

14
.circleci/config.yml Normal file
View File

@ -0,0 +1,14 @@
version: 2.1
jobs:
none:
docker:
- image: alpine:3.10
steps:
- run:
command: echo "Skipping. not implemented"
workflows:
version: 2
mainbuild:
jobs:
- none

View File

@ -1,5 +1,3 @@
sudo: required
services: services:
- docker - docker
@ -12,8 +10,8 @@ install:
- sleep 30 - sleep 30
env: env:
- BUILD="mkdir -p ./volumes/app/mattermost/{data,logs,config} && docker-compose up -d" - BUILD="mkdir -p ./volumes/app/mattermost/{data,logs,config,plugins} && docker-compose up -d"
- BUILD="docker run -d --name db -e POSTGRES_USER=mmuser -e POSTGRES_PASSWORD=mmuser_password -e POSTGRES_DB=mattermost mattermost-prod-db && sleep 5 && docker run -d --link db -p 80:8000 --name app mattermost-prod-app" - BUILD="docker run -d --name db -e POSTGRES_USER=mmuser -e POSTGRES_PASSWORD=mmuser_password -e POSTGRES_DB=mattermost mattermost-prod-db && sleep 5 && docker run -d --link db -p 80:8000 --name app -e MM_USERNAME=mmuser -e MM_PASSWORD=mmuser_password mattermost-prod-app"
script: script:
- curl -sSf http://localhost > /dev/null - curl -sSf http://localhost > /dev/null

5
CONTRIBUTING.md Executable file
View File

@ -0,0 +1,5 @@
# Code Contribution Guidelines
Thank you for your interest in contributing! Please see the [Mattermost Contribution Guide](https://developers.mattermost.com/contribute/getting-started/) which describes the process for making code contributions across Mattermost projects and [join our "Contributors" community channel](https://community.mattermost.com/core/channels/tickets) to ask questions from community members and the Mattermost core team.
When you submit a pull request, it goes through a [code review process outlined here](https://developers.mattermost.com/contribute/getting-started/code-review/).

View File

@ -17,11 +17,10 @@ Please use this long name:
The following people help to maintain this open source project: The following people help to maintain this open source project:
| Current Maintainer(s) | Start Date | | Current Maintainer(s) | Start Date |
|:-----------------------|:--------------| |:--------------------------------------|:--------------|
| Pan Luo - @xcompass | Nov 30 2015 | | Carlos Tadeu Panato Junior - @cpanato | Feb 18 2018 |
| Kyâne Pichou - @pichouk| Jun 01 2017 |
In case something happens where no maintainers are able to complete their responsibilies, the following sponsoring organization can help find a new maintainer: In case something happens where no maintainers are able to complete their responsibilities, the following sponsoring organization can help find a new maintainer:
| Sponsoring Organization | Start Date | | Sponsoring Organization | Start Date |
|:-------------------------------|:--------------| |:-------------------------------|:--------------|
@ -57,8 +56,10 @@ Maintainer(s) should periodically review pull requests and issues submitted to p
PREVIOUS MAINTAINERS PREVIOUS MAINTAINERS
| Maintainer | Start Date | End Date | | Maintainer | Start Date | End Date |
|:-----------------------|:--------------|:------------| |:------------------------|:--------------|:------------|
| Yi EungJun - @npcode | Nov 26 2015 | Nov 30 2016 | | Yi EungJun - @npcode | Nov 26 2015 | Nov 30 2016 |
| Pan Luo - @xcompass | Nov 30 2015 | Feb 21 2019 |
| Kyâne Pichou - @pichouk | Jun 01 2017 | Aug 15 2019 |
CREATOR CREATOR

View File

@ -1,6 +1,12 @@
# Production Docker deployment for Mattermost # Production Docker deployment for Mattermost
This project enables deployment of a Mattermost server in a multi-node production configuration using Docker. ## WARNING:
The current state of this repository doesn't work out-of-the box since Mattermost server v5.31+ requires PostgreSQL versions of 10 or higher.
We're actively working on a fix to this repository. Until then, please refer to these upgrade instructions: https://github.com/mattermost/mattermost-docker/issues/489#issuecomment-790277661
This project enables a deployment of a Mattermost server in a multi-node production configuration using Docker.
[![Build Status](https://travis-ci.org/mattermost/mattermost-docker.svg?branch=master)](https://travis-ci.org/mattermost/mattermost-docker) [![Build Status](https://travis-ci.org/mattermost/mattermost-docker.svg?branch=master)](https://travis-ci.org/mattermost/mattermost-docker)
@ -23,12 +29,15 @@ The following instructions deploy Mattermost in a production configuration using
If you want to install Enterprise Edition, you can skip this section. If you want to install Enterprise Edition, you can skip this section.
To install the team edition, comment out the two following lines in docker-compose.yaml file: To install the team edition, change `build: app` to `build:` and uncomment out these lines in `app:` services block to make it look like below in docker-compose.yaml file:
```yaml ```yaml
args: app:
build:
context: app
args:
- edition=team - edition=team
``` ```
The `app` Dockerfile will read the `edition` build argument to install Team (`edition = 'team'`) or Entreprise (`edition != team`) edition. The `app` Dockerfile will read the `edition` build argument to install Team (`edition = 'team'`) or Enterprise (`edition != team`) edition.
### Database container ### Database container
This repository offer a Docker image for the Mattermost database. It is a customized PostgreSQL image that you should configure with following environment variables : This repository offer a Docker image for the Mattermost database. It is a customized PostgreSQL image that you should configure with following environment variables :
@ -48,9 +57,9 @@ If deploying to AWS, you could also set following variables to enable [Wal-E](ht
All four environment variables are required. It will enable completed WAL segments sent to archive storage (S3). The base backup and clean up can be done through the following command: All four environment variables are required. It will enable completed WAL segments sent to archive storage (S3). The base backup and clean up can be done through the following command:
```bash ```bash
# Base backup # Base backup
docker exec mattermost-db su - postgres sh -c "/usr/bin/envdir /etc/wal-e.d/env /usr/local/bin/wal-e backup-push /var/lib/postgresql/data" docker exec mattermost-db su - postgres sh -c "/usr/bin/envdir /etc/wal-e.d/env /usr/bin/wal-e backup-push /var/lib/postgresql/data"
# Keep the most recent 7 base backups and remove the old ones # Keep the most recent 7 base backups and remove the old ones
docker exec mattermost-db su - postgres sh -c "/usr/bin/envdir /etc/wal-e.d/env /usr/local/bin/wal-e delete --confirm retain 7" docker exec mattermost-db su - postgres sh -c "/usr/bin/envdir /etc/wal-e.d/env /usr/bin/wal-e delete --confirm retain 7"
``` ```
Those tasks can be executed through a cron job or systemd timer. Those tasks can be executed through a cron job or systemd timer.
@ -64,6 +73,13 @@ If your database use some custom host and port, it is also possible to configure
* `DB_HOST`: database host address * `DB_HOST`: database host address
* `DB_PORT_NUMBER`: database port * `DB_PORT_NUMBER`: database port
Use this optional variable if your PostgreSQL connection requires encryption (you may need a certificate authority file and/or a certificate revocation list - check the documentation for your database provider). See the [PostgreSQL notes on encrypted connections](https://www.postgresql.org/docs/current/libpq-ssl.html) for recommendations on what values to use when encryption is needed.
* `DB_SSLMODE`: defaults to `disable`, indicating no encryption
PostgreSQL allows two other variables `sslrootcert` and `sslcrl` for connection strings. However these are not broadly supported when the connection string is specified as a URI. If you need these parameters, use the PostgreSQL-specified environment variables
* `PGSSLROOTCERT` specifies the location of CA file
* `PGSSLCRL` specifies the location of a certificate revocation list file
If you use a Mattermost configuration file on a different location than the default one (`/mattermost/config/config.json`) : If you use a Mattermost configuration file on a different location than the default one (`/mattermost/config/config.json`) :
* `MM_CONFIG`: configuration file location inside the container. * `MM_CONFIG`: configuration file location inside the container.
@ -98,17 +114,27 @@ This image is optional, you should **not** use it when you have your own reverse
* `APP_HOST`: application host address * `APP_HOST`: application host address
* `APP_PORT_NUMBER`: application HTTP port * `APP_PORT_NUMBER`: application HTTP port
If you plan to upload large files to your Mattermost instance, Nginx will need to write some temporary files. In that case, the `read_only: true` option on the `web` container should be removed from your `docker-compose.yml` file.
#### Install with SSL certificate #### Install with SSL certificate
Put your SSL certificate as `./volumes/web/cert/cert.pem` and the private key that has Put your SSL certificate as `./volumes/web/cert/cert.pem` and the private key that has
no password as `./volumes/web/cert/key-no-password.pem`. If you don't have no password as `./volumes/web/cert/key-no-password.pem`. If you don't have
them you may generate a self-signed SSL certificate. them you may generate a self-signed SSL certificate.
#### Configure SSO with GitLab
If you are looking for SSO with GitLab and you use self signed certificate you have to add the PKI chain of your authority in app because Alpine doesn't know him. This is required to avoid **Token request failed: certificate signed by unknown authority**
For that uncomment this line and replace with the correct path of your PKI chain:
```
# - <path_to_your_gitlab_pki>/pki_chain.pem:/etc/ssl/certs/pki_chain.pem:ro
```
### Starting/Stopping Docker ### Starting/Stopping Docker
#### Start #### Start
If you are running docker with non root user, make sure the UID and GID in app/Dockerfile are the same as your current UID/GID If you are running docker with non root user, make sure the UID and GID in app/Dockerfile are the same as your current UID/GID
``` ```
mkdir -p ./volumes/app/mattermost/{data,logs,config} mkdir -p ./volumes/app/mattermost/{data,logs,config,plugins}
chown -R 2000:2000 ./volumes/app/mattermost/ chown -R 2000:2000 ./volumes/app/mattermost/
docker-compose start docker-compose start
``` ```
@ -158,7 +184,7 @@ Docker images for `4.9.0` release introduce some important changes from [PR #241
One important change is that we don't use `root` user by default to run the Mattermost application. So, as explained on [the README](https://github.com/mattermost/mattermost-docker#start), if you use host mounted volume you have to be sure that files on your host server have the correct UID/GID (by default those values are `2000`). In practice, you should just run following commands : One important change is that we don't use `root` user by default to run the Mattermost application. So, as explained on [the README](https://github.com/mattermost/mattermost-docker#start), if you use host mounted volume you have to be sure that files on your host server have the correct UID/GID (by default those values are `2000`). In practice, you should just run following commands :
``` ```
mkdir -p ./volumes/app/mattermost/{data,logs,config} mkdir -p ./volumes/app/mattermost/{data,logs,config,plugins}
chown -R 2000:2000 ./volumes/app/mattermost/ chown -R 2000:2000 ./volumes/app/mattermost/
``` ```
@ -176,7 +202,7 @@ docker-compose build app
docker-compose run app -upgrade_db_30 docker-compose run app -upgrade_db_30
docker-compose up -d docker-compose up -d
``` ```
See the [offical Upgrade Guide](http://docs.mattermost.com/administration/upgrade.html) for more details. See the [official Upgrade Guide](http://docs.mattermost.com/administration/upgrade.html) for more details.
## Installation using Docker Swarm Mode ## Installation using Docker Swarm Mode
@ -191,7 +217,7 @@ Running containerized applications on multi-node swarms involves specific data p
First, create mattermost directory structure on the docker hosts: First, create mattermost directory structure on the docker hosts:
``` ```
mkdir -p /var/lib/mattermost/{cert,config,data,logs} mkdir -p /var/lib/mattermost/{cert,config,data,logs,plugins}
``` ```
Then, fire up the stack in your swarm: Then, fire up the stack in your swarm:

View File

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

View File

@ -2,77 +2,76 @@
# Function to generate a random salt # Function to generate a random salt
generate_salt() { generate_salt() {
cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 48 | head -n 1 tr -dc 'a-zA-Z0-9' </dev/urandom | fold -w 48 | head -n 1
} }
# Read environment variables or set default values # Read environment variables or set default values
DB_HOST=${DB_HOST:-db} DB_HOST=${DB_HOST:-db}
DB_PORT_NUMBER=${DB_PORT_NUMBER:-5432} DB_PORT_NUMBER=${DB_PORT_NUMBER:-5432}
MM_USERNAME=${MM_USERNAME:-mmuser} # see https://www.postgresql.org/docs/current/libpq-ssl.html
MM_PASSWORD=${MM_PASSWORD:-mmuser_password} # for usage when database connection requires encryption
# filenames should be escaped if they contain spaces
# i.e. $(printf %s ${MY_ENV_VAR:-''} | jq -s -R -r @uri)
# the location of the CA file can be set using environment var PGSSLROOTCERT
# the location of the CRL file can be set using PGSSLCRL
# The URL syntax for connection string does not support the parameters
# sslrootcert and sslcrl reliably, so use these PostgreSQL-specified variables
# to set names if using a location other than default
DB_USE_SSL=${DB_USE_SSL:-disable}
MM_DBNAME=${MM_DBNAME:-mattermost} MM_DBNAME=${MM_DBNAME:-mattermost}
MM_CONFIG=${MM_CONFIG:-/mattermost/config/config.json} MM_CONFIG=${MM_CONFIG:-/mattermost/config/config.json}
if [ "${1:0:1}" = '-' ]; then _1=$(echo "$1" | awk '{ s=substr($0, 0, 1); print s; }')
if [ "$_1" = '-' ]; then
set -- mattermost "$@" set -- mattermost "$@"
fi fi
if [ "$1" = 'mattermost' ]; then if [ "$1" = 'mattermost' ]; then
# Check CLI args for a -config option # Check CLI args for a -config option
for ARG in $@; for ARG in "$@"; do
do
case "$ARG" in case "$ARG" in
-config=*) -config=*) MM_CONFIG=${ARG#*=} ;;
MM_CONFIG=${ARG#*=};;
esac esac
done done
if [ ! -f $MM_CONFIG ] if [ ! -f "$MM_CONFIG" ]; then
then
# If there is no configuration file, create it with some default values # If there is no configuration file, create it with some default values
echo "No configuration file" $MM_CONFIG echo "No configuration file $MM_CONFIG"
echo "Creating a new one" echo "Creating a new one"
# Copy default configuration file # Copy default configuration file
cp /config.json.save $MM_CONFIG cp /config.json.save "$MM_CONFIG"
# Substitue some parameters with jq # Substitute some parameters with jq
jq '.ServiceSettings.ListenAddress = ":8000"' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG jq '.ServiceSettings.ListenAddress = ":8000"' "$MM_CONFIG" >"$MM_CONFIG.tmp" && mv "$MM_CONFIG.tmp" "$MM_CONFIG"
jq '.LogSettings.EnableConsole = false' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG jq '.LogSettings.EnableConsole = true' "$MM_CONFIG" >"$MM_CONFIG.tmp" && mv "$MM_CONFIG.tmp" "$MM_CONFIG"
jq '.LogSettings.ConsoleLevel = "INFO"' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG jq '.LogSettings.ConsoleLevel = "ERROR"' "$MM_CONFIG" >"$MM_CONFIG.tmp" && mv "$MM_CONFIG.tmp" "$MM_CONFIG"
jq '.FileSettings.Directory = "/mattermost/data/"' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG jq '.FileSettings.Directory = "/mattermost/data/"' "$MM_CONFIG" >"$MM_CONFIG.tmp" && mv "$MM_CONFIG.tmp" "$MM_CONFIG"
jq '.FileSettings.EnablePublicLink = true' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG jq '.FileSettings.EnablePublicLink = true' "$MM_CONFIG" >"$MM_CONFIG.tmp" && mv "$MM_CONFIG.tmp" "$MM_CONFIG"
jq '.FileSettings.PublicLinkSalt = "'$(generate_salt)'"' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG jq ".FileSettings.PublicLinkSalt = \"$(generate_salt)\"" "$MM_CONFIG" >"$MM_CONFIG.tmp" && mv "$MM_CONFIG.tmp" "$MM_CONFIG"
jq '.EmailSettings.SendEmailNotifications = false' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG jq '.EmailSettings.SendEmailNotifications = false' "$MM_CONFIG" >"$MM_CONFIG.tmp" && mv "$MM_CONFIG.tmp" "$MM_CONFIG"
jq '.EmailSettings.FeedbackEmail = ""' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG jq '.EmailSettings.FeedbackEmail = ""' "$MM_CONFIG" >"$MM_CONFIG.tmp" && mv "$MM_CONFIG.tmp" "$MM_CONFIG"
jq '.EmailSettings.SMTPServer = ""' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG jq '.EmailSettings.SMTPServer = ""' "$MM_CONFIG" >"$MM_CONFIG.tmp" && mv "$MM_CONFIG.tmp" "$MM_CONFIG"
jq '.EmailSettings.SMTPPort = ""' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG jq '.EmailSettings.SMTPPort = ""' "$MM_CONFIG" >"$MM_CONFIG.tmp" && mv "$MM_CONFIG.tmp" "$MM_CONFIG"
jq '.EmailSettings.InviteSalt = "'$(generate_salt)'"' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG jq ".EmailSettings.InviteSalt = \"$(generate_salt)\"" "$MM_CONFIG" >"$MM_CONFIG.tmp" && mv "$MM_CONFIG.tmp" "$MM_CONFIG"
jq '.EmailSettings.PasswordResetSalt = "'$(generate_salt)'"' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG jq ".EmailSettings.PasswordResetSalt = \"$(generate_salt)\"" "$MM_CONFIG" >"$MM_CONFIG.tmp" && mv "$MM_CONFIG.tmp" "$MM_CONFIG"
jq '.RateLimitSettings.Enable = true' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG jq '.RateLimitSettings.Enable = true' "$MM_CONFIG" >"$MM_CONFIG.tmp" && mv "$MM_CONFIG.tmp" "$MM_CONFIG"
jq '.SqlSettings.DriverName = "postgres"' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG jq '.SqlSettings.DriverName = "postgres"' "$MM_CONFIG" >"$MM_CONFIG.tmp" && mv "$MM_CONFIG.tmp" "$MM_CONFIG"
jq '.SqlSettings.AtRestEncryptKey = "'$(generate_salt)'"' $MM_CONFIG > $MM_CONFIG.tmp && mv $MM_CONFIG.tmp $MM_CONFIG jq ".SqlSettings.AtRestEncryptKey = \"$(generate_salt)\"" "$MM_CONFIG" >"$MM_CONFIG.tmp" && mv "$MM_CONFIG.tmp" "$MM_CONFIG"
jq '.PluginSettings.Directory = "/mattermost/plugins/"' "$MM_CONFIG" >"$MM_CONFIG.tmp" && mv "$MM_CONFIG.tmp" "$MM_CONFIG"
else else
echo "Using existing config file" $MM_CONFIG echo "Using existing config file $MM_CONFIG"
fi fi
# Configure database access # Configure database access
if [ -z "$MM_SQLSETTINGS_DATASOURCE" ] if [ -z "$MM_SQLSETTINGS_DATASOURCE" ] && [ -n "$MM_USERNAME" ] && [ -n "$MM_PASSWORD" ]; then
then echo "Configure database connection..."
echo -ne "Configure database connection..."
# URLEncode the password, allowing for special characters # URLEncode the password, allowing for special characters
ENCODED_PASSWORD=$(printf %s $MM_PASSWORD | jq -s -R -r @uri) ENCODED_PASSWORD=$(printf %s "$MM_PASSWORD" | jq -s -R -r @uri)
export MM_SQLSETTINGS_DATASOURCE="postgres://$MM_USERNAME:$ENCODED_PASSWORD@$DB_HOST:$DB_PORT_NUMBER/$MM_DBNAME?sslmode=disable&connect_timeout=10" export MM_SQLSETTINGS_DATASOURCE="postgres://$MM_USERNAME:$ENCODED_PASSWORD@$DB_HOST:$DB_PORT_NUMBER/$MM_DBNAME?sslmode=$DB_USE_SSL&connect_timeout=10"
echo OK echo "OK"
else else
echo "Using existing database connection" echo "Using existing database connection"
fi fi
# Wait for database to be reachable
echo "Wait until database $DB_HOST:$DB_PORT_NUMBER is ready..."
until nc -z $DB_HOST $DB_PORT_NUMBER
do
sleep 1
done
# Wait another second for the database to be properly started. # Wait another second for the database to be properly started.
# Necessary to avoid "panic: Failed to open sql connection pq: the database system is starting up" # Necessary to avoid "panic: Failed to open sql connection pq: the database system is starting up"
sleep 1 sleep 1

5
contrib/aws/.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
# Elastic Beanstalk Files
.elasticbeanstalk/*
!.elasticbeanstalk/*.cfg.yml
!.elasticbeanstalk/*.global.yml

View File

@ -19,6 +19,12 @@
"sourcePath": "/var/app/current/app/mattermost/logs" "sourcePath": "/var/app/current/app/mattermost/logs"
} }
}, },
{
"name": "app-plugins",
"host": {
"sourcePath": "/var/app/current/app/mattermost/plugins"
}
},
{ {
"name": "db-data", "name": "db-data",
"host": { "host": {
@ -37,6 +43,7 @@
"name": "db", "name": "db",
"image": "mattermost/mattermost-prod-db:latest", "image": "mattermost/mattermost-prod-db:latest",
"memory": 128, "memory": 128,
"essential": true,
"mountPoints": [ "mountPoints": [
{ {
"sourceVolume": "db-data", "sourceVolume": "db-data",
@ -60,6 +67,7 @@
"name": "app", "name": "app",
"image": "mattermost/mattermost-prod-app:latest", "image": "mattermost/mattermost-prod-app:latest",
"memory": 128, "memory": 128,
"essential": true,
"mountPoints": [ "mountPoints": [
{ {
"sourceVolume": "app-config", "sourceVolume": "app-config",
@ -72,6 +80,10 @@
{ {
"sourceVolume": "app-logs", "sourceVolume": "app-logs",
"containerPath": "/mattermost/logs" "containerPath": "/mattermost/logs"
},
{
"sourceVolume": "app-plugins",
"containerPath": "/mattermost/plugins"
} }
], ],
"links": [ "links": [
@ -80,8 +92,9 @@
}, },
{ {
"name": "web", "name": "web",
"image": "mattermost/mattermost-prod-web:latest", "image": "mattermost/mattermost-prod-web:5.9.0",
"memory": 128, "memory": 128,
"essential": true,
"mountPoints": [ "mountPoints": [
{ {
"sourceVolume": "web-cert", "sourceVolume": "web-cert",

View File

@ -6,6 +6,8 @@
### Install ### Install
Make the changes in the config file to reflect your needs (app/mattermost/config/config.json)
``` ```
eb init eb init
eb create prod eb create prod

View File

@ -0,0 +1,413 @@
{
"ServiceSettings": {
"SiteURL": "",
"WebsocketURL": "",
"LicenseFileLocation": "",
"ListenAddress": ":8000",
"ConnectionSecurity": "",
"TLSCertFile": "",
"TLSKeyFile": "",
"TLSMinVer": "1.2",
"TLSStrictTransport": false,
"TLSStrictTransportMaxAge": 63072000,
"TLSOverwriteCiphers": [],
"UseLetsEncrypt": false,
"LetsEncryptCertificateCacheFile": "./config/letsencrypt.cache",
"Forward80To443": false,
"ReadTimeout": 300,
"WriteTimeout": 300,
"MaximumLoginAttempts": 10,
"GoroutineHealthThreshold": -1,
"GoogleDeveloperKey": "",
"EnableOAuthServiceProvider": false,
"EnableIncomingWebhooks": true,
"EnableOutgoingWebhooks": true,
"EnableCommands": true,
"EnableOnlyAdminIntegrations": true,
"EnablePostUsernameOverride": false,
"EnablePostIconOverride": false,
"EnableAPIv3": false,
"EnableLinkPreviews": false,
"EnableTesting": false,
"EnableDeveloper": false,
"EnableSecurityFixAlert": true,
"EnableInsecureOutgoingConnections": false,
"AllowedUntrustedInternalConnections": "",
"EnableMultifactorAuthentication": false,
"EnforceMultifactorAuthentication": false,
"EnableUserAccessTokens": false,
"AllowCorsFrom": "",
"CorsExposedHeaders": "",
"CorsAllowCredentials": false,
"CorsDebug": false,
"AllowCookiesForSubdomains": false,
"SessionLengthWebInDays": 30,
"SessionLengthMobileInDays": 30,
"SessionLengthSSOInDays": 30,
"SessionCacheInMinutes": 10,
"SessionIdleTimeoutInMinutes": 0,
"WebsocketSecurePort": 443,
"WebsocketPort": 80,
"WebserverMode": "gzip",
"EnableCustomEmoji": false,
"EnableEmojiPicker": true,
"EnableGifPicker": false,
"GfycatApiKey": "2_KtH_W5",
"GfycatApiSecret": "3wLVZPiswc3DnaiaFoLkDvB4X0IV6CpMkj4tf2inJRsBY6-FnkT08zGmppWFgeof",
"RestrictCustomEmojiCreation": "all",
"RestrictPostDelete": "all",
"AllowEditPost": "always",
"PostEditTimeLimit": -1,
"ExperimentalEnableAuthenticationTransfer": true,
"TimeBetweenUserTypingUpdatesMilliseconds": 5000,
"EnablePostSearch": true,
"EnableUserTypingMessages": true,
"EnableChannelViewedMessages": true,
"EnableUserStatuses": true,
"ClusterLogTimeoutMilliseconds": 2000,
"EnablePreviewFeatures": true,
"CloseUnusedDirectMessages": false,
"EnableTutorial": true,
"ExperimentalEnableDefaultChannelLeaveJoinMessages": true,
"ExperimentalGroupUnreadChannels": "disabled",
"ExperimentalChannelOrganization": false,
"ImageProxyType": "",
"ImageProxyOptions": "",
"ImageProxyURL": "",
"EnableAPITeamDeletion": false,
"ExperimentalEnableHardenedMode": false,
"EnableEmailInvitations": false
},
"TeamSettings": {
"SiteName": "Mattermost",
"MaxUsersPerTeam": 50,
"EnableTeamCreation": true,
"EnableUserCreation": true,
"EnableOpenServer": false,
"EnableUserDeactivation": false,
"RestrictCreationToDomains": "",
"EnableCustomBrand": false,
"CustomBrandText": "",
"CustomDescriptionText": "",
"RestrictDirectMessage": "any",
"RestrictTeamInvite": "all",
"RestrictPublicChannelManagement": "all",
"RestrictPrivateChannelManagement": "all",
"RestrictPublicChannelCreation": "all",
"RestrictPrivateChannelCreation": "all",
"RestrictPublicChannelDeletion": "all",
"RestrictPrivateChannelDeletion": "all",
"RestrictPrivateChannelManageMembers": "all",
"EnableXToLeaveChannelsFromLHS": false,
"UserStatusAwayTimeout": 300,
"MaxChannelsPerTeam": 2000,
"MaxNotificationsPerChannel": 1000,
"EnableConfirmNotificationsToChannel": true,
"TeammateNameDisplay": "username",
"ExperimentalViewArchivedChannels": false,
"ExperimentalEnableAutomaticReplies": false,
"ExperimentalHideTownSquareinLHS": false,
"ExperimentalTownSquareIsReadOnly": false,
"ExperimentalPrimaryTeam": "",
"ExperimentalDefaultChannels": ""
},
"DisplaySettings": {
"CustomUrlSchemes": [],
"ExperimentalTimezone": false
},
"ClientRequirements": {
"AndroidLatestVersion": "",
"AndroidMinVersion": "",
"DesktopLatestVersion": "",
"DesktopMinVersion": "",
"IosLatestVersion": "",
"IosMinVersion": ""
},
"SqlSettings": {
"DriverName": "postgres",
"DataSource": "postgres://mmuser:mmuser_password@db:5432/mattermost?sslmode=disable&connect_timeout=10",
"DataSourceReplicas": [],
"DataSourceSearchReplicas": [],
"MaxIdleConns": 20,
"ConnMaxLifetimeMilliseconds": 3600000,
"MaxOpenConns": 300,
"Trace": false,
"AtRestEncryptKey": "",
"QueryTimeout": 30
},
"LogSettings": {
"EnableConsole": true,
"ConsoleLevel": "DEBUG",
"ConsoleJson": true,
"EnableFile": true,
"FileLevel": "INFO",
"FileJson": true,
"FileLocation": "",
"EnableWebhookDebugging": true,
"EnableDiagnostics": true
},
"PasswordSettings": {
"MinimumLength": 5,
"Lowercase": false,
"Number": false,
"Uppercase": false,
"Symbol": false
},
"FileSettings": {
"EnableFileAttachments": true,
"EnableMobileUpload": true,
"EnableMobileDownload": true,
"MaxFileSize": 52428800,
"DriverName": "local",
"Directory": "./data/",
"EnablePublicLink": false,
"PublicLinkSalt": "",
"InitialFont": "nunito-bold.ttf",
"AmazonS3AccessKeyId": "",
"AmazonS3SecretAccessKey": "",
"AmazonS3Bucket": "",
"AmazonS3Region": "",
"AmazonS3Endpoint": "s3.amazonaws.com",
"AmazonS3SSL": true,
"AmazonS3SignV2": false,
"AmazonS3SSE": false,
"AmazonS3Trace": false
},
"EmailSettings": {
"EnableSignUpWithEmail": true,
"EnableSignInWithEmail": true,
"EnableSignInWithUsername": true,
"SendEmailNotifications": true,
"UseChannelInEmailNotifications": false,
"RequireEmailVerification": false,
"FeedbackName": "",
"FeedbackEmail": "test@example.com",
"FeedbackOrganization": "",
"EnableSMTPAuth": false,
"SMTPUsername": "",
"SMTPPassword": "",
"SMTPServer": "dockerhost",
"SMTPPort": "2500",
"ConnectionSecurity": "",
"InviteSalt": "",
"SendPushNotifications": true,
"PushNotificationServer": "https://push-test.mattermost.com",
"PushNotificationContents": "generic",
"EnableEmailBatching": false,
"EmailBatchingBufferSize": 256,
"EmailBatchingInterval": 30,
"EnablePreviewModeBanner": true,
"SkipServerCertificateVerification": false,
"EmailNotificationContentsType": "full",
"LoginButtonColor": "",
"LoginButtonBorderColor": "",
"LoginButtonTextColor": ""
},
"RateLimitSettings": {
"Enable": false,
"PerSec": 10,
"MaxBurst": 100,
"MemoryStoreSize": 10000,
"VaryByRemoteAddr": true,
"VaryByUser": false,
"VaryByHeader": ""
},
"PrivacySettings": {
"ShowEmailAddress": true,
"ShowFullName": true
},
"SupportSettings": {
"TermsOfServiceLink": "https://about.mattermost.com/default-terms/",
"PrivacyPolicyLink": "https://about.mattermost.com/default-privacy-policy/",
"AboutLink": "https://about.mattermost.com/default-about/",
"HelpLink": "https://about.mattermost.com/default-help/",
"ReportAProblemLink": "https://about.mattermost.com/default-report-a-problem/",
"SupportEmail": "feedback@mattermost.com"
},
"AnnouncementSettings": {
"EnableBanner": false,
"BannerText": "",
"BannerColor": "#f2a93b",
"BannerTextColor": "#333333",
"AllowBannerDismissal": true
},
"ThemeSettings": {
"EnableThemeSelection": true,
"DefaultTheme": "default",
"AllowCustomThemes": true,
"AllowedThemes": []
},
"TimezoneSettings": {
"SupportedTimezonesPath": "timezones.json"
},
"GitLabSettings": {
"Enable": false,
"Secret": "",
"Id": "",
"Scope": "",
"AuthEndpoint": "",
"TokenEndpoint": "",
"UserApiEndpoint": ""
},
"GoogleSettings": {
"Enable": false,
"Secret": "",
"Id": "",
"Scope": "profile email",
"AuthEndpoint": "https://accounts.google.com/o/oauth2/v2/auth",
"TokenEndpoint": "https://www.googleapis.com/oauth2/v4/token",
"UserApiEndpoint": "https://www.googleapis.com/plus/v1/people/me"
},
"Office365Settings": {
"Enable": false,
"Secret": "",
"Id": "",
"Scope": "User.Read",
"AuthEndpoint": "https://login.microsoftonline.com/common/oauth2/v2.0/authorize",
"TokenEndpoint": "https://login.microsoftonline.com/common/oauth2/v2.0/token",
"UserApiEndpoint": "https://graph.microsoft.com/v1.0/me"
},
"LdapSettings": {
"Enable": false,
"EnableSync": false,
"LdapServer": "",
"LdapPort": 389,
"ConnectionSecurity": "",
"BaseDN": "",
"BindUsername": "",
"BindPassword": "",
"UserFilter": "",
"FirstNameAttribute": "",
"LastNameAttribute": "",
"EmailAttribute": "",
"UsernameAttribute": "",
"NicknameAttribute": "",
"IdAttribute": "",
"PositionAttribute": "",
"LoginIdAttribute": "",
"SyncIntervalMinutes": 60,
"SkipCertificateVerification": false,
"QueryTimeout": 60,
"MaxPageSize": 0,
"LoginFieldName": "",
"LoginButtonColor": "",
"LoginButtonBorderColor": "",
"LoginButtonTextColor": ""
},
"ComplianceSettings": {
"Enable": false,
"Directory": "./data/",
"EnableDaily": false
},
"LocalizationSettings": {
"DefaultServerLocale": "en",
"DefaultClientLocale": "en",
"AvailableLocales": ""
},
"SamlSettings": {
"Enable": false,
"EnableSyncWithLdap": false,
"EnableSyncWithLdapIncludeAuth": false,
"Verify": true,
"Encrypt": true,
"IdpUrl": "",
"IdpDescriptorUrl": "",
"AssertionConsumerServiceURL": "",
"ScopingIDPProviderId": "",
"ScopingIDPName": "",
"IdpCertificateFile": "",
"PublicCertificateFile": "",
"PrivateKeyFile": "",
"IdAttribute": "",
"FirstNameAttribute": "",
"LastNameAttribute": "",
"EmailAttribute": "",
"UsernameAttribute": "",
"NicknameAttribute": "",
"LocaleAttribute": "",
"PositionAttribute": "",
"LoginButtonText": "SAML",
"LoginButtonColor": "",
"LoginButtonBorderColor": "",
"LoginButtonTextColor": ""
},
"NativeAppSettings": {
"AppDownloadLink": "https://about.mattermost.com/downloads/",
"AndroidAppDownloadLink": "https://about.mattermost.com/mattermost-android-app/",
"IosAppDownloadLink": "https://about.mattermost.com/mattermost-ios-app/"
},
"ClusterSettings": {
"Enable": false,
"ClusterName": "",
"OverrideHostname": "",
"UseIpAddress": true,
"UseExperimentalGossip": false,
"ReadOnlyConfig": true,
"GossipPort": 8074,
"StreamingPort": 8075,
"MaxIdleConns": 100,
"MaxIdleConnsPerHost": 128,
"IdleConnTimeoutMilliseconds": 90000
},
"MetricsSettings": {
"Enable": false,
"BlockProfileRate": 0,
"ListenAddress": ":8067"
},
"ExperimentalSettings": {
"ClientSideCertEnable": false,
"ClientSideCertCheck": "secondary",
"EnablePostMetadata": false
},
"AnalyticsSettings": {
"MaxUsersForStatistics": 2500
},
"ElasticsearchSettings": {
"ConnectionUrl": "http://dockerhost:9200",
"Username": "elastic",
"Password": "changeme",
"EnableIndexing": false,
"EnableSearching": false,
"Sniff": true,
"PostIndexReplicas": 1,
"PostIndexShards": 1,
"AggregatePostsAfterDays": 365,
"PostsAggregatorJobStartTime": "03:00",
"IndexPrefix": "",
"LiveIndexingBatchSize": 1,
"BulkIndexingTimeWindowSeconds": 3600,
"RequestTimeoutSeconds": 30
},
"DataRetentionSettings": {
"EnableMessageDeletion": false,
"EnableFileDeletion": false,
"MessageRetentionDays": 365,
"FileRetentionDays": 365,
"DeletionJobStartTime": "02:00"
},
"MessageExportSettings": {
"EnableExport": false,
"DailyRunTime": "01:00",
"ExportFromTimestamp": 0,
"FileLocation": "export",
"BatchSize": 10000,
"GlobalRelaySettings": {
"CustomerType": "A9",
"SmtpUsername": "",
"SmtpPassword": "",
"EmailAddress": ""
}
},
"JobSettings": {
"RunJobs": true,
"RunScheduler": true
},
"PluginSettings": {
"Enable": true,
"EnableUploads": false,
"Directory": "./plugins",
"ClientDirectory": "./client/plugins",
"Plugins": {},
"PluginStates": {}
}
}

View File

@ -76,7 +76,7 @@ Type: NodePort
IP: 10.0.0.194 IP: 10.0.0.194
Port: http 80/TCP Port: http 80/TCP
NodePort: http 32283/TCP NodePort: http 32283/TCP
Endpoints: 172.17.0.4:80 Endpoints: 172.17.0.4:8000
Session Affinity: None Session Affinity: None
No events. No events.
``` ```
@ -90,7 +90,7 @@ curl -L http://192.168.99.100:32283
### Optional steps ### Optional steps
* If you want your data to be persistent you will need to make persistent volumes for Mattermost and Postgres. * If you want your data to be persistent you will need to make persistent volumes for Mattermost and Postgres. This requires adding a [securityContext](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#discussion) to the deployment to set `runAsUser: 2000`, `runAsGroup: 2000` and `fsGroup: 2000`.
* If you want to change advanced settings for the mattermost container you can make a [configMap](http://blog.kubernetes.io/2016/04/configuration-management-with-containers.html) for the /mattermost/config/config.json file * If you want to change advanced settings for the mattermost container you can make a [configMap](http://blog.kubernetes.io/2016/04/configuration-management-with-containers.html) for the /mattermost/config/config.json file
* If you want the application exposed on port 80 you can either specify the port in the service manifest or use an [ingress controller](http://kubernetes.io/docs/user-guide/ingress/#ingress-controllers) and an ingress map for the mattermost service. A sample ingress map would be * If you want the application exposed on port 80 you can either specify the port in the service manifest or use an [ingress controller](http://kubernetes.io/docs/user-guide/ingress/#ingress-controllers) and an ingress map for the mattermost service. A sample ingress map would be
``` ```

View File

@ -17,14 +17,14 @@ spec:
spec: spec:
containers: containers:
- name: mattermost-app - name: mattermost-app
image: "mattermost/mattermost-prod-app:4.7.0" image: "mattermost/mattermost-prod-app:5.14.1"
env: env:
- name: DB_HOST - name: DB_HOST
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: mattermost.env name: mattermost.env
key: db-host key: db-host
- name: DB_PORT - name: DB_PORT_NUMBER
valueFrom: valueFrom:
secretKeyRef: secretKeyRef:
name: mattermost.env name: mattermost.env
@ -45,14 +45,14 @@ spec:
name: mattermost.env name: mattermost.env
key: mm-dbname key: mm-dbname
volumeMounts: volumeMounts:
# optional persistant storage # optional persistent storage
#- name: appdata #- name: appdata
#mountPath: /mattermost/data #mountPath: /mattermost/data
- name: etclocaltime - name: etclocaltime
mountPath: /etc/localtime mountPath: /etc/localtime
readOnly: true readOnly: true
volumes: volumes:
# optional persistant storage # optional persistent storage
#- name: appdata #- name: appdata
#persistentVolumeClaim: #persistentVolumeClaim:
# claimName: mattermost-app # claimName: mattermost-app

View File

@ -7,7 +7,7 @@ spec:
type: NodePort type: NodePort
ports: ports:
- port: 80 - port: 80
targetPort: 80 targetPort: 8000
protocol: TCP protocol: TCP
name: http name: http
selector: selector:

View File

@ -59,7 +59,7 @@ services:
condition: on-failure condition: on-failure
app: app:
# use official mattermost prod-app image # use official mattermost prod-app image
image: mattermost/mattermost-prod-app image: mattermost/mattermost-prod-app:5.13.0
networks: networks:
- mm-in - mm-in
- mm-out - mm-out
@ -67,6 +67,7 @@ services:
- /var/lib/mattermost/config:/mattermost/config:rw - /var/lib/mattermost/config:/mattermost/config:rw
- /var/lib/mattermost/data:/mattermost/data:rw - /var/lib/mattermost/data:/mattermost/data:rw
- /var/lib/mattermost/logs:/mattermost/logs:rw - /var/lib/mattermost/logs:/mattermost/logs:rw
- /var/lib/mattermost/plugins:/mattermost/plugins:rw
- /etc/localtime:/etc/localtime:ro - /etc/localtime:/etc/localtime:ro
environment: environment:
# use service's hostname # use service's hostname
@ -108,7 +109,18 @@ services:
- "443:443" - "443:443"
networks: networks:
- mm-out - mm-out
command: --acme --acme.email="[ADD YOUR EMAIL HERE]" --acme.entrypoint=https --acme.onhostrule --acme.storage="acme/certs.json" --acme.acmelogging --web --docker --docker.domain=docker.localhost --docker.swarmmode --docker.watch --logLevel=DEBUG command: >
--acme
--acme.email="[ADD YOUR EMAIL HERE]"
--acme.entrypoint=https --acme.onhostrule
--acme.storage="acme/certs.json"
--acme.acmelogging
--web
--docker
--docker.domain=docker.localhost
--docker.swarmmode
--docker.watch
--logLevel=DEBUG
volumes: volumes:
# traefik needs the docker socket in order to work properly # traefik needs the docker socket in order to work properly
- /var/run/docker.sock:/var/run/docker.sock - /var/run/docker.sock:/var/run/docker.sock

View File

@ -5,12 +5,12 @@
# #
# `docker stack up [STACK NAME] -c docker-stack.yml` # `docker stack up [STACK NAME] -c docker-stack.yml`
# #
# In this case `mm` is going to be stack name, so the command will be: # In this case `mattermost` is going to be stack name, so the command will be:
# #
# `docker stack up mm -c docker-stack.yml` # `docker stack up mattermost -c docker-stack.yml`
# #
# From now on all the services that belong to this stack will be prefixed with `mm_` # From now on all the services that belong to this stack will be prefixed with `mattermost_`
# this file defines 3 services, these are going to be mm_db, mm_app and mm_web, # this file defines 3 services, these are going to be mattermost_db, mattermost_app and mattermost_web,
# each of these names is the service's hostname as well, they can communicate # each of these names is the service's hostname as well, they can communicate
# with each other easily by using the hostname instead of the ip or exposing ports to the host. # with each other easily by using the hostname instead of the ip or exposing ports to the host.
# #
@ -58,7 +58,7 @@ services:
condition: on-failure condition: on-failure
app: app:
# use official mattermost prod-app image # use official mattermost prod-app image
image: mattermost/mattermost-prod-app image: mattermost/mattermost-prod-app:5.13.0
networks: networks:
- mm-in - mm-in
- mm-out - mm-out
@ -66,10 +66,11 @@ services:
- /var/lib/mattermost/config:/mattermost/config:rw - /var/lib/mattermost/config:/mattermost/config:rw
- /var/lib/mattermost/data:/mattermost/data:rw - /var/lib/mattermost/data:/mattermost/data:rw
- /var/lib/mattermost/logs:/mattermost/logs:rw - /var/lib/mattermost/logs:/mattermost/logs:rw
- /var/lib/mattermost/plugins:/mattermost/plugins:rw
- /etc/localtime:/etc/localtime:ro - /etc/localtime:/etc/localtime:ro
environment: environment:
# use service's hostname # use service's hostname
- DB_HOST=mm_db - DB_HOST=db
# talk to the port within the overlay network # talk to the port within the overlay network
# without (over)exposing ports # without (over)exposing ports
- DB_PORT_NUMBER=5432 - DB_PORT_NUMBER=5432
@ -98,7 +99,7 @@ services:
- /etc/localtime:/etc/localtime:ro - /etc/localtime:/etc/localtime:ro
environment: environment:
# use app service's hostname # use app service's hostname
- APP_HOST=mm_app - APP_HOST=app
# talk to the port within the overlay network # talk to the port within the overlay network
# without (over)exposing ports # without (over)exposing ports
- APP_PORT_NUMBER=80 - APP_PORT_NUMBER=80

View File

@ -3,6 +3,7 @@ FROM postgres:9.4-alpine
ENV DEFAULT_TIMEZONE UTC ENV DEFAULT_TIMEZONE UTC
# Install some packages to use WAL # Install some packages to use WAL
RUN echo "azure<5.0.0" > pip-constraints.txt
RUN apk add --no-cache \ RUN apk add --no-cache \
build-base \ build-base \
curl \ curl \
@ -12,18 +13,21 @@ RUN apk add --no-cache \
python-dev \ python-dev \
py-pip \ py-pip \
py-cryptography \ py-cryptography \
&& pip --no-cache-dir install 'wal-e<1.0.0' envdir \ pv \
libressl-dev \
&& pip install --upgrade pip \
&& pip --no-cache-dir install -c pip-constraints.txt 'wal-e<1.0.0' envdir \
&& rm -rf /var/cache/apk/* /tmp/* /var/tmp/* && rm -rf /var/cache/apk/* /tmp/* /var/tmp/*
# Add wale script # Add wale script
COPY setup-wale.sh /docker-entrypoint-initdb.d/ COPY setup-wale.sh /docker-entrypoint-initdb.d/
#Healthcheck to make sure container is ready #Healthcheck to make sure container is ready
HEALTHCHECK CMD pg_isready -U postgres || exit 1 HEALTHCHECK CMD pg_isready -U $POSTGRES_USER -d $POSTGRES_DB || exit 1
# Add and configure entrypoint and command # Add and configure entrypoint and command
COPY entrypoint.sh / COPY entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/entrypoint.sh"]
CMD ["postgres"] CMD ["postgres"]
VOLUME ["/var/run/postgresql", "/usr/share/postgresql/", "/var/lib/postgresql/data", "/tmp"] VOLUME ["/var/run/postgresql", "/usr/share/postgresql/", "/var/lib/postgresql/data", "/tmp", "/etc/wal-e.d/env"]

View File

@ -5,7 +5,7 @@ export WAL_LEVEL=${WAL_LEVEL:-minimal}
export ARCHIVE_MODE=${ARCHIVE_MODE:-off} export ARCHIVE_MODE=${ARCHIVE_MODE:-off}
export ARCHIVE_TIMEOUT=${ARCHIVE_TIMEOUT:-60} export ARCHIVE_TIMEOUT=${ARCHIVE_TIMEOUT:-60}
function update_conf () { function update_conf() {
wal=$1 wal=$1
# PGDATA is defined in upstream postgres dockerfile # PGDATA is defined in upstream postgres dockerfile
config_file=$PGDATA/postgresql.conf config_file=$PGDATA/postgresql.conf
@ -23,11 +23,11 @@ function update_conf () {
sed -i "s/archive_command =.*$//g" $config_file sed -i "s/archive_command =.*$//g" $config_file
# Configure wal-e # Configure wal-e
if [ "$wal" = true ] ; then if [ "$wal" = true ]; then
/docker-entrypoint-initdb.d/setup-wale.sh /docker-entrypoint-initdb.d/setup-wale.sh
fi fi
echo "log_timezone = $DEFAULT_TIMEZONE" >> $config_file echo "log_timezone = $DEFAULT_TIMEZONE" >>$config_file
echo "timezone = $DEFAULT_TIMEZONE" >> $config_file echo "timezone = $DEFAULT_TIMEZONE" >>$config_file
} }
if [ "${1:0:1}" = '-' ]; then if [ "${1:0:1}" = '-' ]; then
@ -46,7 +46,7 @@ if [ "$1" = 'postgres' ]; then
done done
# Setup wal-e env variables # Setup wal-e env variables
if [ "$wal_enable" = true ] ; then if [ "$wal_enable" = true ]; then
for v in ${VARS[@]}; do for v in ${VARS[@]}; do
export $v="${!v}" export $v="${!v}"
done done
@ -58,5 +58,5 @@ if [ "$1" = 'postgres' ]; then
update_conf $wal_enable update_conf $wal_enable
# Run the postgresql entrypoint # Run the postgresql entrypoint
. /docker-entrypoint.sh docker-entrypoint.sh postgres
fi fi

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# wal-e specific configuration # wal-e specific configuration
echo "wal_level = $WAL_LEVEL" >> $PGDATA/postgresql.conf echo "wal_level = $WAL_LEVEL" >>$PGDATA/postgresql.conf
echo "archive_mode = $ARCHIVE_MODE" >> $PGDATA/postgresql.conf echo "archive_mode = $ARCHIVE_MODE" >>$PGDATA/postgresql.conf
echo "archive_command = '/usr/bin/wal-e wal-push %p'" >> $PGDATA/postgresql.conf echo "archive_command = '/usr/bin/wal-e wal-push %p'" >>$PGDATA/postgresql.conf
echo "archive_timeout = $ARCHIVE_TIMEOUT" >> $PGDATA/postgresql.conf echo "archive_timeout = $ARCHIVE_TIMEOUT" >>$PGDATA/postgresql.conf

22
docker-compose.yml Normal file → Executable file
View File

@ -1,4 +1,4 @@
version: "2" version: "3"
services: services:
@ -27,31 +27,41 @@ services:
# - edition=team # - edition=team
# - PUID=1000 # - PUID=1000
# - PGID=1000 # - PGID=1000
# - MM_VERSION=5.31
restart: unless-stopped restart: unless-stopped
volumes: volumes:
- ./volumes/app/mattermost/config:/mattermost/config:rw - ./volumes/app/mattermost/config:/mattermost/config:rw
- ./volumes/app/mattermost/data:/mattermost/data:rw - ./volumes/app/mattermost/data:/mattermost/data:rw
- ./volumes/app/mattermost/logs:/mattermost/logs:rw - ./volumes/app/mattermost/logs:/mattermost/logs:rw
- ./volumes/app/mattermost/plugins:/mattermost/plugins:rw
- ./volumes/app/mattermost/client-plugins:/mattermost/client/plugins:rw
- /etc/localtime:/etc/localtime:ro - /etc/localtime:/etc/localtime:ro
# When you want to use SSO with GitLab, you have to add the cert pki chain of GitLab inside Alpine
# to avoid Token request failed: certificate signed by unknown authority (link: https://github.com/mattermost/mattermost-server/issues/13059)
# - <path_to_your_gitlab_pki>/pki_chain.pem:/etc/ssl/certs/pki_chain.pem:ro
environment: environment:
# set same as db credentials and dbname # set same as db credentials and dbname
- MM_USERNAME=mmuser - MM_USERNAME=mmuser
- MM_PASSWORD=mmuser_password - MM_PASSWORD=mmuser_password
- MM_DBNAME=mattermost - MM_DBNAME=mattermost
# use the credentials you've set above, in the format:
# MM_SQLSETTINGS_DATASOURCE=postgres://${MM_USERNAME}:${MM_PASSWORD}@db:5432/${MM_DBNAME}?sslmode=disable&connect_timeout=10
- MM_SQLSETTINGS_DATASOURCE=postgres://mmuser:mmuser_password@db:5432/mattermost?sslmode=disable&connect_timeout=10
# in case your config is not in default location # in case your config is not in default location
#- MM_CONFIG=/mattermost/config/config.json #- MM_CONFIG=/mattermost/config/config.json
web: web:
build: web build: web
ports: ports:
- "80:80" - "80:8080"
- "443:443" - "443:8443"
read_only: true read_only: true
restart: unless-stopped restart: unless-stopped
volumes: volumes:
# This directory must have cert files if you want to enable SSL # This directory must have cert files if you want to enable SSL
- ./volumes/web/cert:/cert:ro - ./volumes/web/cert:/cert:ro
- /etc/localtime:/etc/localtime:ro - /etc/localtime:/etc/localtime:ro
# Uncomment for SSL cap_drop:
# environment: - ALL
# - MATTERMOST_ENABLE_SSL=true

View File

@ -1,17 +1,38 @@
FROM nginx:mainline-alpine FROM nginxinc/nginx-unprivileged:mainline-alpine
USER root
# Remove default configuration and add our custom Nginx configuration files # Remove default configuration and add our custom Nginx configuration files
RUN rm /etc/nginx/conf.d/default.conf \ RUN rm /etc/nginx/conf.d/default.conf \
&& apk add --no-cache curl && apk add --no-cache curl
COPY ["./mattermost", "./mattermost-ssl", "/etc/nginx/sites-available/"] COPY ["./mattermost", "./mattermost-ssl", "/etc/nginx/sites-available/"]
COPY ./security.conf /etc/nginx/conf.d/
# Add and setup entrypoint # Add and setup entrypoint
COPY entrypoint.sh / COPY entrypoint.sh /
RUN chown -R nginx:nginx /etc/nginx/sites-available && \
chown -R nginx:nginx /var/cache/nginx && \
chown -R nginx:nginx /var/log/nginx && \
chown -R nginx:nginx /etc/nginx/conf.d && \
chown nginx:nginx entrypoint.sh
RUN touch /var/run/nginx.pid && \
chown -R nginx:nginx /var/run/nginx.pid
COPY ./security.conf /etc/nginx/conf.d/
RUN chown -R nginx:nginx /etc/nginx/conf.d/security.conf
RUN chmod u+x /entrypoint.sh
RUN sed -i "/^http {/a \ proxy_buffering off;\n" /etc/nginx/nginx.conf
RUN sed -i '/temp_path/d' /etc/nginx/nginx.conf \
&& sed -i 's!/tmp/nginx.pid!/var/run/nginx.pid!g' /etc/nginx/nginx.conf
USER nginx
#Healthcheck to make sure container is ready #Healthcheck to make sure container is ready
HEALTHCHECK CMD curl --fail http://localhost:80 || exit 1 HEALTHCHECK CMD curl --fail http://localhost:8080 || exit 1
ENTRYPOINT ["/entrypoint.sh"] ENTRYPOINT ["/entrypoint.sh"]

View File

@ -11,12 +11,14 @@ if [ -f "/cert/cert.pem" -a -f "/cert/key-no-password.pem" ]; then
else else
echo "linking plain config" echo "linking plain config"
fi fi
# Ensure that the configuration file is not present before linking.
test -w /etc/nginx/conf.d/mattermost.conf && rm /etc/nginx/conf.d/mattermost.conf
# Linking Nginx configuration file # Linking Nginx configuration file
ln -s /etc/nginx/sites-available/mattermost$ssl /etc/nginx/conf.d/mattermost.conf ln -s -f /etc/nginx/sites-available/mattermost$ssl /etc/nginx/conf.d/mattermost.conf
# Setup app host and port on configuration file # Setup app host and port on configuration file
sed -i "s/{%APP_HOST%}/${APP_HOST}/g" /etc/nginx/conf.d/mattermost.conf sed -i "s/{%APP_HOST%}/${APP_HOST}/g" /etc/nginx/conf.d/mattermost.conf
sed -i "s/{%APP_PORT%}/${APP_PORT_NUMBER}/g" /etc/nginx/conf.d/mattermost.conf sed -i "s/{%APP_PORT%}/${APP_PORT_NUMBER}/g" /etc/nginx/conf.d/mattermost.conf
# Run Nginx # Run Nginx
nginx -g 'daemon off;' exec nginx -g 'daemon off;'

View File

@ -4,7 +4,7 @@ map $http_x_forwarded_proto $proxy_x_forwarded_proto {
} }
server { server {
listen 80; listen 8080;
location ~ /api/v[0-9]+/(users/)?websocket$ { location ~ /api/v[0-9]+/(users/)?websocket$ {
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;

13
web/mattermost-ssl Normal file → Executable file
View File

@ -1,5 +1,5 @@
server { server {
listen 80 default_server; listen 8080 default_server;
server_name _; server_name _;
return 301 https://$host$request_uri; return 301 https://$host$request_uri;
} }
@ -10,15 +10,16 @@ map $http_x_forwarded_proto $proxy_x_forwarded_proto {
} }
server { server {
listen 443 ssl http2; listen 8443 ssl http2;
ssl on;
ssl_certificate /cert/cert.pem; ssl_certificate /cert/cert.pem;
ssl_certificate_key /cert/key-no-password.pem; ssl_certificate_key /cert/key-no-password.pem;
ssl_session_timeout 5m; ssl_session_timeout 5m;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:MEDIUM:!SSLv2:!PSK:!SRP:!ADH:!AECDH; # Please update the ciphers in this file every 6 months.
ssl_prefer_server_ciphers on; # https://ssl-config.mozilla.org/
ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384;
ssl_prefer_server_ciphers off;
location ~ /api/v[0-9]+/(users/)?websocket$ { location ~ /api/v[0-9]+/(users/)?websocket$ {
proxy_set_header Upgrade $http_upgrade; proxy_set_header Upgrade $http_upgrade;