[SOLVED ]Running in Docker Swarm


Can’t get Mattermost to start in Docker Swarm.

Steps to reproduce

I’m trying to test this on a mac. I followed the Official Guide and I can get the Docker Compose file to work, I can access the mattermost and configure everything, but we want to deploy this with docker swarm, but when I try to run the contrib/swarm/docker-stack.yml it fails.

Observed behavior

The mm_app and mm_db both are starting and running correctly from all I can see, the one that isn’t running when I run docker stack ps mm


[emerg] 9#9: host not found in upstream "mm_app" in /etc/nginx/conf.d/mattermost.conf:21
nginx: [emerg] host not found in upstream "mm_app" in /etc/nginx/conf.d/mattermost.conf:21
[error] 10#10: *5 connect() failed (111: Connection refused) while connecting to upstream, client:, server: , request: "GET / HTTP/1.1", upstream: "", host: "localhost" - - [29/Jul/2018:18:43:59 +0000] "GET / HTTP/1.1" 502 166 "-" "curl/7.61.0" "-" 

I understand this is a problem in the nginx conf file, but I don’t understand how to fix this, since line 21 is
proxy_pass http://{%APP_HOST%}:{%APP_PORT%};
which I believe is the one in the that is written in docker-stack.yml that is mm_app.

I never used docker swarm before so sorry if this is a stupid mistake.

Hi @paulo! Thanks for reaching out.

Please take a look at this doc, or let me know if you have already taken a look at it / if it wasn’t helpful in this case: https://github.com/mattermost/mattermost-docker#installation-using-docker-swarm-mode.

Hi @amy.blais!

I have already tried that, first I tried https://docs.mattermost.com/install/prod-docker.html and I was able to get it running with docker compose, and then I followed that and I wasn’t able to get it working. I don’t know if this is a matter I should be asking here or in a nginx forum so sorry if I’m mistaken!

Thanks for the reply :slight_smile:

Pinging @pichouk as a next step :slight_smile:

I found the problem, at least now it is working, when I get home I will try to replicate and confirm the problem and do a PR. The App has the port 8000 exposed but the web image is listening to 80.

1 Like