jasl8r / docker-mattermost

Docker solution for mattermost
MIT License
15 stars 20 forks source link

Use platform CLI #11

Closed cduverne closed 7 years ago

cduverne commented 7 years ago

Hello @jasl8r,

Thanks a lot for version 3.4 ! I was wondering how we could delete teams within the docker containers, it looks like the sql connection toward an external postgresql container isn't working.

bash-4.3# ./platform
[2016/10/26 08:57:42 UTC] [INFO] Loaded system translations for 'en' from '/opt/mattermost/mattermost/i18n/en.json'
[2016/10/26 08:57:42 UTC] [INFO] Current version is 3.4.0 (3.4.0/Wed Oct 26 04:02:27 UTC 2016/57f25fa59c71821cc38fd220b133aa6a40815e12/none)
[2016/10/26 08:57:42 UTC] [INFO] Enterprise Enabled: false
[2016/10/26 08:57:42 UTC] [INFO] Current working directory is /opt/mattermost/mattermost/bin
[2016/10/26 08:57:42 UTC] [INFO] Loaded config file from /opt/mattermost/mattermost/config/config.json
[2016/10/26 08:57:42 UTC] [INFO] Server is initializing...
[2016/10/26 08:57:42 UTC] [INFO] Pinging sql master database
[2016/10/26 08:57:42 UTC] [CRIT] Failed to ping db err:dial tcp: lookup dockerhost on 10.0.2.3:53: no such host

How could we do ? Thanks in advance. Cyrille

cduverne commented 7 years ago

I succeeded in having it working by changing the sqlsettings of the config.json file.

But what I don't understand is how the config is loaded into mattermost, because the config.json file used by platform is the one in /opt/mattermost/config/config.json and it doesn't contains the right connection string.

Is there another config file in the container ?

jasl8r commented 7 years ago

If you are starting the container directly into bash, rather than exec into a running container then you will need to create the config from a the template. See https://github.com/jasl8r/docker-mattermost/blob/master/entrypoint.sh#L8 for where this is handled for the main entrypoint.

Basically after your docker run ... bash you'll want to:

> initialize
> configure
> # do work

We could add an app:bash command perhaps that automates this and drops you into a bash shell.

cduverne commented 7 years ago

Thanks a lot ! It works too !