我尝试通过阅读指南来应用它。app.yml 文件就是这样生成的。其中可能存在错误。我只是在使用 Docker。我想要实现:在虚拟服务器上运行两个站点。1. 站点名称:dursuncan.com,2. 站点名称:forum.tekno-byte.com。我该如何编辑 app.yml 文件?
# ./launcher rebuild app
WARNING: We are about to start downloading the Discourse base image
This process may take anywhere between a few minutes to an hour, depending on your network speed
Please be patient
2.0.20210415-1332: Pulling from discourse/base
Digest: sha256:b3b1eb6d859d683f26ad2a02e0efabcd502a63ab07b8211e4c425aa7ba7dd3a4
Status: Downloaded newer image for discourse/base:2.0.20210415-1332
docker.io/discourse/base:2.0.20210415-1332
Ensuring launcher is up to date
Fetching origin
Launcher is up-to-date
Stopping old container
+ /usr/bin/docker stop -t 60 app
app
cd /pups && git pull && git checkout v1.0.3 && /pups/bin/pups --stdin
docker: Error response from daemon: could not get container for postgres: No such container: postgres.
See 'docker run --help'.
cat: cids/app_bootstrap.cid: No such file or directory
"docker rm" requires at least 1 argument.
See 'docker rm --help'.
Usage: docker rm [OPTIONS] CONTAINER [CONTAINER...],
Remove one or more containers
rm: cannot remove 'cids/app_bootstrap.cid': No such file or directory
** FAILED TO BOOTSTRAP ** please scroll up and look for earlier error messages, there may be more than one.
./discourse-doctor may help diagnose the problem.
## 这是 Discourse Docker 容器的全功能独立模板
##
## 修改此文件后,您必须重新构建
## /var/discourse/launcher rebuild app
##
## 编辑时请*非常*小心!
## YAML 文件对空白或对齐错误极其敏感!
## 必要时请访问 http://www.yamllint.com/ 验证此文件
templates:
- "templates/postgres.template.yml"
- "templates/redis.template.yml"
- "templates/web.template.yml"
- "templates/web.ratelimited.template.yml"
- "templates/cron.template.yml"
## 如果希望添加 Lets Encrypt (https),请取消注释以下两行
- "templates/sshd.template.yml"
- "templates/web.ssl.template.yml"
- "templates/web.letsencrypt.ssl.template.yml"
## 此容器应暴露哪些 TCP/IP 端口?
## 如果您希望 Discourse 与 Apache 或 nginx 等其他 Web 服务器共享端口,
## 请参阅 https://meta.discourse.org/t/17247 了解详情
expose:
# - "80"
- "80:80"
- "2222:22"
- "443:443"
# - "80:80" # http
# - "443:443" # https
links:
- link:
name: postgres
alias: postgres
#docker_args:
# - "--net chain"
params:
db_default_text_search_config: "pg_catalog.english"
## 将 db_shared_buffers 设置为总内存的最大 25%。
## 将根据检测到的 RAM 自动由引导程序设置,您也可以覆盖
#db_shared_buffers: "256MB"
## 可以提高排序性能,但会增加每个连接的内存使用量
#db_work_mem: "40MB"
## 此容器应使用哪个 Git 修订版?(默认:tests-passed)
#version: tests-passed
env:
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
LANGUAGE: en_US.UTF-8
# DISCOURSE_DEFAULT_LOCALE: en
## 支持的并发 Web 请求数量?取决于内存和 CPU 核心数。
## 将根据检测到的 CPU 自动由引导程序设置,您也可以覆盖
#UNICORN_WORKERS: 3
## TODO: 此 Discourse 实例将响应的域名
## 必填项。Discourse 无法在纯 IP 地址上运行。
DISCOURSE_HOSTNAME: 'dursuncan.com'
# VIRTUAL_HOST: 'dursuncan.com,www.dursuncan.com'
# LETSENCRYPT_HOST: 'dursuncan.com,www.dursuncan.com'
# LETSENCRYPT_EMAIL: 'merhaba@dursuncan.com'
## 如果希望容器以与上述相同的主机名(-h 选项)启动,请取消注释
## (默认值为 "$hostname-$config")
# DOCKER_USE_HOSTNAME: true
## TODO: 初始注册时将设为管理员和开发者的逗号分隔电子邮件列表
## 示例:'user1@example.com,user2@example.com'
DISCOURSE_DEVELOPER_EMAILS: 'poyrazdursuncan@gmail.com'
## TODO: 用于验证新账户和发送通知的 SMTP 邮件服务器
# 需要 SMTP 地址、用户名和密码
# 警告:SMTP 密码中的字符 '#' 可能会引发问题!
DISCOURSE_SMTP_ADDRESS: smtp.eu.mailgun.org
DISCOURSE_SMTP_PORT: 587
DISCOURSE_SMTP_USER_NAME: postmaster@mg.dursuncan.com
DISCOURSE_SMTP_PASSWORD: '***'
DISCOURSE_SMTP_ENABLE_START_TLS: true
DISCOURSE_SMTP_DOMAIN: dursuncan.com
#DISCOURSE_NOTIFICATION_EMAIL: noreply@discourse.example.com # (发送通知的地址)
## 如果已添加 Lets Encrypt 模板,请取消注释以下行以获取免费 SSL 证书
LETSENCRYPT_ACCOUNT_EMAIL: 'merhaba@dursuncan.com'
## 此 Discourse 实例的 http 或 https CDN 地址(配置为拉取)
## 请参阅 https://meta.discourse.org/t/14857 了解详情
#DISCOURSE_CDN_URL: https://discourse-cdn.example.com
## Maxmind 地理位置 IP 地址查询的密钥
## 请参阅 https://meta.discourse.org/t/-/137387/23 了解详情
#DISCOURSE_MAXMIND_LICENSE_KEY: 1234567890123456
DISCOURSE_DB_HOST: some-host
DISCOURSE_DB_NAME: "{{config}}_discourse"
labels:
monitor: "true"
app_name: "{{config}}_discourse"
## Docker 容器是无状态的;所有数据都存储在 /shared 中
volumes:
- volume:
host: /var/discourse/shared/standalone
guest: /shared
- volume:
host: /var/discourse/shared/standalone/log/var-log
guest: /var/log
## 插件放在此处
## 请参阅 https://meta.discourse.org/t/19157 了解详情
hooks:
after_postgres:
- 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
db_id: 2
host_names:
- b.discourse.example.com
after_bundle_exec:
- exec: cd /var/discourse && sudo -E -u discourse bundle exec rake multisite:migrate
## 构建后运行的任何自定义命令
run:
- exec:
cd: var/discourse
hook: my_hook
cmd:
- echo 1
## 如果希望设置首次注册的“发件人”电子邮件地址,请取消注释并修改:
## 收到首次注册邮件后,请重新注释该行。它只需运行一次。
#- exec: rails r "SiteSetting.notification_email='info@unconfigured.discourse.org'"
- exec: echo "End of custom commands"