Sto configurando un secondo sito Discourse sullo stesso server e sto utilizzando un reverse proxy per gestire il traffico. Non ho molta esperienza con gli aspetti tecnici, quindi sto cercando una guida per assicurarmi che tutto sia configurato correttamente. Di seguito è riportato il file app1.yml che ho utilizzato per il nuovo container.
Voglio sapere se questa configurazione mi permetterà di eseguire due istanze Discourse in parallelo.
Configurazione (app1.yml):
## questo è il template del container Docker Discourse standalone all-in-one
##
## Dopo aver apportato modifiche a questo file, DEVI ricostruire
## /var/discourse/launcher rebuild app1
##
## FAI MOLTA *ATTENZIONE QUANDO MODIFICHI!*
## I FILE YAML SONO ESTREMAMENTE SENSIBILI A ERRORI DI SPAZIATURA O ALLINEAMENTO!
## visita http://www.yamllint.com/ per validare questo file se necessario
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
## quali porte TCP/IP deve esporre questo container?
## Se vuoi che Discourse condivida una porta con un altro webserver come Apache o nginx,
## vedi https://meta.discourse.org/t/17247 per i dettagli
expose:
#- "80" # porta HTTP interna
#- "443" # porta HTTPS interna
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"
Dato che non ho molta familiarità con la programmazione, qualsiasi consiglio o miglioramento a questa configurazione sarebbe molto apprezzato!