다중 사이트(discourse) 인스턴스를 가지고 놀다가, app.yml의 hooks에서 사이트를 정의하는 대신 이걸 외부 파일(예: multisite.yml)로 만들 수 있는지 궁금합니다. 이 파일은 Docker 컨테이너가 아닌 호스트 VPS에만 두고, 적어도 호스트에서 설정할 수 있게 하고 싶습니다. 아니면 sh 파일로 discourse 포럼을 DB 테이블에 정의하는 방법이 있을까요?
또한, 전체 앱을 다시 빌드하지 않고 새 사이트를 추가할 수 있는 명령줄이나 방법이 있는지也想 알고 싶습니다.
hooks:
after_postgres:
# b_discourse 대신 각 사이트 DB에 대해 설정해야 합니다.
- exec: sudo -u postgres createdb b_discourse || exit 0
- exec:
stdin: |
grant all privileges on database b_discourse to discourse;
cmd: sudo -u postgres psql b_discourse
raise_on_fail: false
- exec: /bin/bash -c 'sudo -u postgres psql b_discourse <<< "alter schema public owner to discourse;"'
- exec: /bin/bash -c 'sudo -u postgres psql b_discourse <<< "create extension if not exists hstore;"'
- exec: /bin/bash -c 'sudo -u postgres psql b_discourse <<< "create extension if not exists pg_trgm;"'
after_code:
- exec:
cd: $home/plugins
cmd:
- mkdir -p plugins
- git clone https://github.com/discourse/docker_manager.git
before_bundle_exec:
- file:
path: $home/config/multisite.yml
contents: |
secondsite:
adapter: postgresql
database: b_discourse
pool: 25
timeout: 5000
host_names:
- sub.domain.tld
after_bundle_exec:
- exec: cd /var/www/discourse && sudo -H -E -u discourse bundle exec rake multisite:migrate
저에게 Discourse 다중 사이트는 처음이지만, MediaWiki 멀티사이트 설정은 해본 경험이 있어 익숙합니다.