같은 서버에 두 번째 Discourse 사이트를 설정하고 있으며, 트래픽 관리를 위해 리버스 프록시를 사용하고 있습니다. 기술적인 부분에 익숙하지 않아 모든 것이 올바르게 구성되었는지 확인하기 위해 조언을 구합니다. 아래는 새 컨테이너에 사용한 app1.yml 파일입니다.
이 설정으로 두 개의 Discourse 인스턴스를 병렬로 실행할 수 있을지 알고 싶습니다.
설정 (app1.yml):
## this is the all-in-one, standalone Discourse Docker container template
##
## After making changes to this file, you MUST rebuild
## /var/discourse/launcher rebuild app1
##
## BE *VERY* CAREFUL WHEN EDITING!
## YAML FILES ARE SUPER SENSITIVE TO MISTAKES IN WHITESPACE OR ALIGNMENT!
## visit http://www.yamllint.com/ to validate this file as needed
templates:
- "templates/postgres.template.yml"
- "templates/redis.template.yml"
- "templates/web.template.yml"
- "templates/web.ratelimited.template.yml"
- "templates/web.socketed.template.yml"
- "templates/web.ssl.template.yml"
- "templates/web.letsencrypt.ssl.template.yml"
image: discourse/discourse:latest
## 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" # internal HTTP port
#- "443" # internal HTTPS port
params:
db_default_text_search_config: "pg_catalog.english"
db_shared_buffers: "2048MB"
upload_size: 100m
env:
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
LANGUAGE: en_US.UTF-8
DISCOURSE_DEFAULT_LOCALE: zh_CN
DISCOURSE_FORCE_HTTPS: 'true'
UNICORN_WORKERS: 8
DISCOURSE_HOSTNAME: xxxx.com
DISCOURSE_DEVELOPER_EMAILS: 'youremail@xxxx.com'
DISCOURSE_SMTP_ADDRESS: xxxxx
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: your_smtp_username
DISCOURSE_SMTP_PASSWORD: "your_smtp_password"
DISCOURSE_NOTIFICATION_EMAIL: no-reply@xxxx.com
LETSENCRYPT_ACCOUNT_EMAIL: me@example.com
DISCOURSE_MAXMIND_LICENSE_KEY: xxxxxxx
volumes:
- volume:
host: /var/discourse/shared/app1
guest: /shared
- volume:
host: /var/discourse/shared/app1/log/var-log
guest: /var/log
hooks:
after_postgres:
- exec: sudo -u postgres createdb discourse_app1 || exit 0
- exec:
stdin: |
grant all privileges on database discourse_app1 to discourse;
cmd: sudo -u postgres psql discourse_app1
- exec: /bin/bash -c 'sudo -u postgres psql discourse_app1 <<< "alter schema public owner to discourse;"'
- exec: /bin/bash -c 'sudo -u postgres psql discourse_app1 <<< "create extension if not exists hstore;"'
- exec: /bin/bash -c 'sudo -u postgres psql discourse_app1 <<< "create extension if not exists pg_trgm;"'
run:
- exec: echo "Beginning of custom commands"
- exec: echo "End of custom commands"
코딩에 익숙하지 않아 이 설정에 대한 조언이나 개선 사항이 있다면 정말 감사하겠습니다!