DiscourseをPortainerでインストール

I use Portainer to manage my Containers. I wanted to install Discourse in a new container but I’m unable to do so. If anyone can help me with this would be appreciated.

WHAT I TRIED?
I read the GitHub File and tried to follow it but I was unable to run console commands as I have not created a container. So I created/cloned an image of Discourse in DockerHub and installed it through Portainer but when I run it says exited with error code 0.

Why is this unsupported install @rishabh? Portainer is just a Docker Control Panel.

Because they only support one installation type, which is in a clean VPS where all the modifications and scripts run without any issue. Anything else is a custom installation and they won’t support it as the ways to use containers is infinite.

To be able to install Discourse, you need to run the bootstrapping done via the launcher utility. If you can add scripts to Portainer it should be relatively easy to do. Or you can just install Discourse in a VPS and push the resulting container to see if that works.

Other way, which could be easier is to decouple everything and deploy them individually, this means (in no way a complete list):

  • PostgreSQL
  • Redis
  • Unicorns
  • Discourse
「いいね!」 1

Yes we have only one official install largely to allow our community to support it well. If we had more, it would be difficult for everyone to provide quality troubleshooting and setup advice.

「いいね!」 4

What you’ll need to do is use ./launcher to build your container and then launch it with portainer, passing all of the environment variables needed.

See Can Discourse ship frequent Docker images that do not need to be bootstrapped? for more discussion.

The easy solution that you can get free help with is to follow the official install instructions. If you need help with portainer and have a budget you can ask in marketplace or contact me. I’m not familiar with portainer, but have built containers to launch with other tools.

「いいね!」 1

インテリジェントに見られたくないのですが、このランチャーユーティリティはどこにありますか?プルしたDockerイメージの /discourse パスを見ていましたが、スクリプトが見つかりませんでした…また、見間違えているのでしょうか?テストのために、標準的なUbuntu Dockerコンテナを実行して、すべて自分で構成するつもりですか?標準インストールのように?

以下のような手順が見つかりました。

Bitnami Discourse Docker Image を取得する推奨方法は、Docker Hub Registry から事前ビルドされたイメージをプルすることです。

docker pull bitnami/discourse:latest

特定のバージョンを使用するには、バージョンタグをプルできます。Docker Hub Registry で利用可能なバージョンのリストを確認できます。

docker pull bitnami/discourse:[TAG]

必要に応じて、リポジトリをクローンし、Dockerfile を含むディレクトリに変更して docker build コマンドを実行することで、自分でイメージをビルドすることもできます。以下の例のコマンドで、APPVERSIONOPERATING-SYSTEM のパスプレースホルダーを正しい値に置き換えることを忘れないでください。

git clone https://github.com/bitnami/containers.git
cd bitnami/APP/VERSION/OPERATING-SYSTEM
docker build -t bitnami/APP:latest .

このイメージの使用方法

Discourse は、情報を保存するために PostgreSQL データベースへのアクセスが必要です。データベースの要件には、Bitnami PostgreSQL Docker Image⁠ を使用します。

Docker コマンドラインの使用

ステップ 1: ネットワークの作成

docker network create discourse-network

ステップ 2: PostgreSQL の永続化のためのボリュームを作成し、PostgreSQL コンテナを作成する

$ docker volume create --name postgresql_data
docker run -d --name postgresql \
  --env ALLOW_EMPTY_PASSWORD=yes \
  --env POSTGRESQL_USERNAME=bn_discourse \
  --env POSTGRESQL_PASSWORD=bitnami123 \
  --env POSTGRESQL_DATABASE=bitnami_discourse \
  --network discourse-network \
  --volume postgresql_data:/bitnami/postgresql \
  bitnami/postgresql:latest

ステップ 3: Redis の永続化のためのボリュームを作成し、Redis コンテナを作成する

$ docker volume create --name redis_data
docker run -d --name redis \
  --env ALLOW_EMPTY_PASSWORD=yes \
  --network discourse-network \
  --volume redis_data:/bitnami/redis \
  bitnami/redis:latest

ステップ 4: Discourse の永続化のためのボリュームを作成し、コンテナを起動する

$ docker volume create --name discourse_data
docker run -d --name discourse \
  -p 8080:8080 -p 8443:8443 \
  --env ALLOW_EMPTY_PASSWORD=yes \
  --env DISCOURSE_DATABASE_USER=bn_discourse \
  --env DISCOURSE_DATABASE_PASSWORD=bitnami123 \
  --env DISCOURSE_DATABASE_NAME=bitnami_discourse \
  --env DISCOURSE_HOST=www.example.com \
  --network discourse-network \
  --volume discourse_data:/bitnami/discourse \
  bitnami/discourse:latest

ステップ 5: Sidekiq コンテナを起動する

docker run -d --name sidekiq \
  --network discourse-network \
  --volume discourse_data:/bitnami/discourse \
  bitnami/discourse:latest /opt/bitnami/scripts/discourse-sidekiq/run.sh

アプリケーションに http://your-ip/ でアクセスします。

Docker Compose を使用してアプリケーションを実行する
curl -sSL https://raw.githubusercontent.com/bitnami/containers/main/bitnami/discourse/docker-compose.yml > docker-compose.yml
docker-compose up -d

このファイルは内部テストを受けていないことに注意してください。したがって、開発またはテスト目的でのみ使用することをお勧めします。本番環境へのデプロイには、関連する Bitnami Helm chart⁠ を使用することを強く推奨します。

docker-compose.yaml ファイルに問題が見つかった場合は、Contributing Guidelines⁠ に従って報告するか、修正に貢献してください。

Discourse のトラブルシューティング

コンソールから管理者アカウントを作成⁠ のような Discourse 管理コマンドを実行する必要がある場合は、コンテナ内でシェルを実行し、適切な環境変数で実行できます。

cd /opt/bitnami/discourse
RAILS_ENV=production bundle exec rake admin:create