what parts of your
.env file did you change? Only the domain? Running the docker compose command without creating the SSL certificates first (you will not see this in the short deploy documentation, this needs to be done manually) usually is a reason why the nginx container is restarting all the time.
You can try to debug that by running the command
docker logs <containerid> to see what’s going on. I’ve prepared a setup here with a broken nginx container, this is what
docker ps looks like:
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
eb94836985da nginx:alpine "/docker-entrypoint.…" 2 minutes ago Restarting (1) 46 seconds ago nginx_mattermost
88f4f2c50fcf mattermost/mattermost-enterprise-edition:6.3 "/entrypoint.sh matt…" 2 minutes ago Up 2 minutes (healthy) 8065/tcp, 8067/tcp, 8074-8075/tcp mm-711-mattermost-1
bb0bbb33d085 postgres:13-alpine "docker-entrypoint.s…" 2 minutes ago Up 2 minutes 5432/tcp mm-711-postgres-1
As you can see, container
eb94836985da is in “restarting” mode, so you can check the logs using this command:
root@ag-bitch0101:~/mattermost/mm-7.1.1# docker logs eb94836985da
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: can not modify /etc/nginx/conf.d/default.conf (read-only file system?)
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
nginx: [emerg] cannot load certificate "/cert.pem": PEM_read_bio_X509_AUX() failed (SSL: error:0909006C:PEM routines:get_name:no start line:Expecting: TRUSTED CERTIFICATE)
And in my case you can see, that it’s having problems with loading the certificate and is therefore restarting.
What’s the output of your
docker logs command for both restarting containers?
Also you MIGHT need a newer docker version, because the mattermost docker build works with variable substitutions in the docker-compose files and at least the docker-compose binaries that ship with Debian by default do not support that, so I had to use the versions from download.docker.com (you can find instructions for all majjor operating systems online, here the link for Debian f.ex.: Install Docker Engine on Debian | Docker Documentation ).
Once done, please note that it’s not
docker-compose anymore, but
docker compose (it’s now a parameter to the docker binary and not a standalone binary anymore).
But that’s just guessing for the reasons without seeing the logs, but out of my experience, these are the two major reasons why containers are restarting on a fresh deployment.
On another sidenote: The docker deployment still defaults to Mattermost 6.3 and the enterprise version, so depending on your requirements, you might also want to change these two lines in the
## This will be 'mattermost-enterprise-edition' or 'mattermost-team-edition' based on the version of Mattermost you're installing.
The most recent version (released yesterday) is 7.1.1.