CoolifyにDiscourseサービスを追加:GUIサーバー&アプリケーション管理

サーバー上で実行されているサービスを管理するための素晴らしいサーバーパネルを最近見つけました。それはCoolifyと呼ばれ、正常にインストールし、現在n8nやその他のスクリプトのインストールと制御に使用して2つのサーバーを管理しています。

Coolifyで私にとって唯一不足しているサービスはDiscourseです。もし皆さんがDiscourseをCoolifyサービスに追加できれば、それは素晴らしいことでしょう。そして、この世界に新しく来た人には、まずCoolifyをインストールしてからDiscourseを有効にするように伝えることができます。

彼らのロードマップでは、Discourseを追加するリクエストをすでに発見しました: https://feedback.coolify.io/posts/108/service-discourse しかし残念ながら、彼らのコミュニティであまり多くの人がDiscourseを知りません。

「いいね!」 5

Discourse は Docker Compose ではなく独自のランチャーを使用しているため、Web UI からのインストールに深く統合する準備ができていませんでした。私が望み、達成したのは、Coolify マスターサーバー上で Discourse を実行し、組み込みの Traefik を介して適切なコンテナにルーティングすることです。

ホストは GitHub - discourse/discourse_docker: A Docker image for Discourse と最新の Coolify v4.0.0-beta.360 を実行しています。

これには、わずかな Discourse の再構成のみが必要でした。これを行うために、/var/discourse/containers/app.yml でソケットサーバーを無効にし、次にラベルと docker_args を使用して、Traefik が Discourse を見つけ、HTTP->HTTPS リダイレクトを処理し、証明書を取得し、FORUM-HOSTNAME.COM から Discourse コンテナへのリクエストをプロキシするように設定しました。

templates:
  - "templates/postgres.template.yml"
  - "templates/redis.template.yml"
  - "templates/web.template.yml"
  ## Uncomment the next line to enable the IPv6 listener
  #- "templates/web.ipv6.template.yml"
  - "templates/web.ratelimited.template.yml"
  ## Uncomment these two lines if you wish to add Lets Encrypt (https)
#  - "templates/web.ssl.template.yml"
#  - "templates/web.letsencrypt.ssl.template.yml"
#  - "templates/web.socketed.template.yml"

## which TCP/IP ports should this container expose?
## If you want Discourse to share a port with another webserver like Apache or nginx,
## see https://meta.discourse.org/t/17247 for details
expose:
#  - "80:80"   # http
#  - "443:443" # https

docker_args:
  - "--network=coolify"

labels:
  app_name: discourse
  traefik.enable: true

  traefik.http.middlewares.discourse_redirect2https.redirectscheme.scheme: https
  traefik.http.middlewares.gzip.compress: true

  traefik.http.routers.discourse.rule: Host(`FORUM-HOSTNAME.COM`)
  traefik.http.routers.discourse.entrypoints: http
  traefik.http.routers.discourse.middlewares: discourse_redirect2https

  traefik.http.routers.discourse_secure.rule: Host(`FORUM-HOSTNAME.COM`)
  traefik.http.routers.discourse_secure.entrypoints: https
  traefik.http.routers.discourse_secure.tls: true
  traefik.http.routers.discourse_secure.tls.certresolver: letsencrypt
  traefik.http.routers.discourse_secure.middlewares: gzip
  traefik.http.services.discourse_secure.loadbalancer.server.port: 80

次に ./launcher rebuild app を実行し、完了後にホストの nginx を停止し、ポート 80/443 を占有する coolify-proxy コンテナを実行できるようになり、残りを処理しました。私たちのコミュニティは Coolify ホストで稼働しており、Coolify が残りのソフトウェアを管理しています。

「いいね!」 5