0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

WindowsPC上でDockerを利用してMattermostコンテナを起動する

Last updated at Posted at 2025-01-24

概要

Mattermostはオープンソースのチャットツールです。
クラウドサービス版とオンプレミス版があり、機能は制限されますが無償で利用できるバージョンもあります。

Mattermostの機能を調べる機会があり、検証のためローカルPC上にDockerを利用してMattermostコンテナを起動した際の手順をまとめました。

環境

環境情報は以下の通りです。

  • 端末OS:Windows 11 Pro 23H2
  • コンテナツール:Rancher Desktop 1.16.0
  • Mattermostコンテナ:mattermost-team-edition 10.1.1

環境構築手順

Rancher Desktop

以下の記事を参考にRancher Desktop公式サイトからインストーラをダウンロードし、インストールおよび初期セットアップします。

Mattermost

Mattermostの資材ファイルをGitHubからダウンロードします。

> git clone https://github.com/mattermost/docker

ダウンロードしたdockerフォルダ配下に以下のフォルダを作成します。

.
└─volumes
    └─app
        └─mattermost
            ├─bleve-indexes
            ├─client
            │  └─plugins
            ├─config
            ├─data
            ├─logs
            └─plugins

dockerフォルダ配下にあるenv.exampleファイルをコピーして.envファイルを作成し、環境に合わせて編集します。
今回の場合、ローカル環境で実行するために以下のような変更をしています。

# Domain of service
DOMAIN=localhost      #<--- ローカルで起動するため「localhost」に変更
# Container settings
## Timezone inside the containers. The value needs to be in the form 'Europe/Berlin'.
## A list of these tz database names can be looked up at Wikipedia
## https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
TZ=Asia/Tokyo      #<--- タイムゾーンを「Asia/Tokyo」に変更
## This will be 'mattermost-enterprise-edition' or 'mattermost-team-edition' based on the version of Mattermost you're installing.
MATTERMOST_IMAGE=mattermost-team-edition      #<--- 無償版の「mattermost-team-edition」に変更
## Update the image tag if you want to upgrade your Mattermost version. You may also upgrade to the latest one. The example is based on the latest Mattermost ESR version.
MATTERMOST_IMAGE_TAG=10.1.1      #<--- 検証当時の最新バージョンを指定
## Example settings (any additional setting added here also needs to be introduced in the docker-compose.yml)
MM_SERVICESETTINGS_SITEURL=http://${DOMAIN}:8065      #<--- ローカルで起動するため非SSL化 & WebSocketエラー対策にポート番号追加

.envファイルの編集が完了したら、dockerフォルダ配下で以下のコマンドを実行し、Mattermostコンテナを起動します。※

> docker compose -f docker-compose.yml -f docker-compose.without-nginx.yml up -d

設定に問題がなければ、以下のように2つのコンテナが起動しているはずです。

> docker compose ps
NAME                  IMAGE                                       COMMAND                   SERVICE      CREATED         STATUS                   PORTS
docker-mattermost-1   mattermost/mattermost-team-edition:10.1.1   "/entrypoint.sh matt…"   mattermost   5 minutes ago   Up 5 minutes (healthy)   8067/tcp, 0.0.0.0:8065->8065/tcp, :::8065->8065/tcp, 0.0.0.0:8443->8443/tcp, :::8443->8443/tcp, 8074-8075/tcp, 0.0.0.0:8443->8443/udp, :::8443->8443/udp
docker-postgres-1     postgres:13-alpine                          "docker-entrypoint.s…"   postgres     5 minutes ago   Up 5 minutes             5432/tcp

※補足

Mattermostコンテナ起動時、以下のような警告メッセージが出力される場合がありますが、コンテナの実行に影響はありません。

 level=warning msg="C:\\tools\\mattermost\\docker\\docker-compose.yml: the attribute `version` is obsolete, it will be ignored, please remove it to avoid potential confusion"

今回の手順でRancherDesktopとともに導入したdocker composeはV2となります。
V2からComposeファイルの記法が変わっていますが、現時点(2025/1/16時点)でGitHubに登録されているMattermostコンテナのComposeファイルはV1時代の記法のままのようです。
そのため、ダウンロードしたComposeファイルをそのまま利用しようとすると、V2で不要となった設定に対して警告メッセージが出力されます。
警告メッセージが気になる場合は、GitHubからダウンロードしたComposeファイルからversion:設定を削除してください。

コンテナの起動を確認できたら、Webブラウザでhttp://localhost:8065に接続します。
正常に起動していれば、以下のような初期設定画面が表示されます。
local_mattermost_001.JPG

画面の指示に従って初期アカウント、チームを設定し、 Finish setupボタンをクリックすると、初期設定完了です。
local_mattermost_002.JPG

local_mattermost_003.JPG

local_mattermost_004.JPG

初期設定したチームのTown Square チャンネル(チーム作成時に自動作成されるデフォルトチャンネル)と初回ログイン時のTipsが表示されます。
local_mattermost_005.JPG

参考

https://docs.mattermost.com/install/install-docker.html
https://zenn.dev/harpseal/articles/8dc2602ffe3365

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?