Coolify에 Discourse 서비스 추가: GUI 서버 및 애플리케이션 관리

최근 서버에서 실행되는 서비스를 관리하기 위해 놀라운 서버 패널을 발견했습니다. 이름은 Coolify이며, 성공적으로 설치하여 현재 2대의 서버에서 n8n 및 기타 스크립트의 설치와 관리를 위해 사용하고 있습니다.

제게 Coolify에서 빠져 있는 유일한 서비스는 Discourse입니다. 만약 Coolify에 Discourse를 추가해 주신다면 정말 멋진 일이 될 것이며, 이제부터 이 분야에 처음 입문하는 사람들에게 Coolify를 설치한 후 Discourse를 활성화하라고 간단히 안내할 수 있을 것입니다.

로드맵에서 이미 Discourse 추가 요청을 찾았습니다: https://feedback.coolify.io/posts/108/service-discourse 하지만 안타깝게도 그들의 커뮤니티에서 Discourse를 아는 사람들이 많지 않습니다.

6개의 좋아요

Discourse는 Docker Compose가 아닌 자체 launcher를 사용하므로, Web UI를 통해 설치하도록 깊이 통합할 준비가 되어 있지 않았습니다. 제가 원하고 달성한 것은 Discourse가 Coolify 마스터 서버에서 실행되고, 내장된 Traefik을 통해 올바른 컨테이너로 라우팅되는 것이었습니다.

호스트는 https://github.com/discourse/discourse_docker와 최신 버전인 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가 나머지 소프트웨어를 관리하고 있습니다.

6개의 좋아요