将Discourse服务加入Coolify:图形界面服务器与应用程序管理

我最近发现了这个出色的服务器面板,用于管理服务器上运行的服务。它叫做 Coolify,我已经成功安装并正在使用它来管理 2 台服务器,安装和控制 n8n 及其他脚本。

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 并运行 coolify-proxy 容器来占用 80/443 端口,它会处理其余的事情:我们的社区已经在 Coolify 主机上运行,Coolify 负责管理其余的软件。

5 个赞