84 lines
2.7 KiB
YAML
84 lines
2.7 KiB
YAML
## Discourse container config for cadCAD community forum
|
|
## Deployed behind Traefik reverse proxy on Netcup RS 8000
|
|
##
|
|
## This file gets copied to /opt/discourse/containers/app.yml on the server.
|
|
## After editing, rebuild with: cd /opt/discourse && ./launcher rebuild app
|
|
|
|
templates:
|
|
- "templates/postgres.template.yml"
|
|
- "templates/redis.template.yml"
|
|
- "templates/web.template.yml"
|
|
## SSL handled by Cloudflare/Traefik - do NOT enable these:
|
|
# - "templates/web.ssl.template.yml"
|
|
# - "templates/web.letsencrypt.ssl.template.yml"
|
|
- "templates/web.ratelimited.template.yml"
|
|
|
|
## No direct port exposure - Traefik routes traffic via Docker network
|
|
## expose:
|
|
## - "80:80"
|
|
|
|
params:
|
|
db_default_text_search_config: "pg_catalog.english"
|
|
## 2GB total container limit, tune DB accordingly
|
|
db_shared_buffers: "128MB"
|
|
db_work_mem: "10MB"
|
|
|
|
env:
|
|
LC_ALL: en_US.UTF-8
|
|
LANG: en_US.UTF-8
|
|
LANGUAGE: en_US.UTF-8
|
|
|
|
DISCOURSE_DEFAULT_LOCALE: en
|
|
|
|
## Temporary domain - will switch to community.cadcad.org later
|
|
DISCOURSE_HOSTNAME: 'cadcad-forum.jeffemmett.com'
|
|
|
|
## Admin email for initial setup
|
|
DISCOURSE_DEVELOPER_EMAILS: 'jeff@jeffemmett.com'
|
|
|
|
## SMTP via local mailcow (internal relay, no auth needed)
|
|
DISCOURSE_SMTP_ADDRESS: 10.100.0.253
|
|
DISCOURSE_SMTP_PORT: 25
|
|
DISCOURSE_SMTP_ENABLE_START_TLS: false
|
|
DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: none
|
|
DISCOURSE_SMTP_DOMAIN: jeffemmett.com
|
|
DISCOURSE_NOTIFICATION_EMAIL: noreply@jeffemmett.com
|
|
|
|
## Serve behind reverse proxy
|
|
DISCOURSE_FORCE_HTTPS: true
|
|
|
|
volumes:
|
|
- volume:
|
|
host: /opt/discourse/shared/standalone
|
|
guest: /shared
|
|
- volume:
|
|
host: /opt/discourse/shared/standalone/log/var-log
|
|
guest: /var/log
|
|
|
|
hooks:
|
|
after_code:
|
|
- exec:
|
|
cd: $home/plugins
|
|
cmd:
|
|
## Add plugins here (uncomment as needed):
|
|
# - git clone https://github.com/discourse/docker_manager.git
|
|
# - git clone https://github.com/discourse/discourse-solved.git
|
|
# - git clone https://github.com/discourse/discourse-voting.git
|
|
- echo "Plugin installation complete"
|
|
|
|
## Memory limit: 2GB container + 2GB swap
|
|
run:
|
|
- exec: echo "Beginning of custom commands"
|
|
## Fix CSRF issues behind Cloudflare/Traefik reverse proxy chain.
|
|
## Force X-Forwarded-Proto to always be https since all external traffic comes via Cloudflare.
|
|
- exec:
|
|
cmd: sed -i 's/default \$scheme;/default https;/' /etc/nginx/conf.d/discourse.conf
|
|
|
|
## Traefik integration labels
|
|
labels:
|
|
app_name: discourse
|
|
traefik.enable: "true"
|
|
traefik.docker.network: traefik-public
|
|
traefik.http.routers.discourse.rule: "Host(`demo.rforum.online`) || Host(`cadcad-forum.jeffemmett.com`)"
|
|
traefik.http.services.discourse.loadbalancer.server.port: "80"
|