# discourse launcher / docker 是否使用本地的 postgresql 和 redis 服务器？

**URL:** https://meta.discourse.org/t/does-discourse-launcher-docker-use-the-local-postgresql-and-redis-servers/289398
**Category:** Self-hosting
**Created:** [2023年十二月21日 00:47 UTC](https://meta.discourse.org/t/does-discourse-launcher-docker-use-the-local-postgresql-and-redis-servers/289398 "2023-12-21T00:47:41Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![dalu74](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dalu74/32/350170_2.png) [@dalu74](https://meta.discourse.org/u/dalu74)
#### Post date: [2023年十二月21日 00:47 UTC](https://meta.discourse.org/t/does-discourse-launcher-docker-use-the-local-postgresql-and-redis-servers/289398/1 "2023-12-21T00:47:41Z")

</div>

今天我在新主机上通过 Docker 安装了 discourse，大致参考了此帖：

> [@Run other websites on the same machine as Discourse](https://meta.discourse.org/t/run-other-websites-on-the-same-machine-as-discourse/17247):
>
> @pfaffman edited this heavily 2022.02.24. Blame me if it’s broken. If you want to run other websites on the same machine as Discourse, you need to set up an extra NGINX or HAProxy proxy in front of the Docker container. NOTE: This is for advanced admins This guide assumes you already have Discourse working - if you don’t, it may be hard to tell whether or not the configuration is working. You cannot use ./discourse-setup to set up Discourse if another server is using port 80 or 443. You will …

[安装前文档](https://github.com/discourse/discourse/blob/main/docs/INSTALL.md)提到应安装 Postgresql13+ Ruby 3.2+ 和 Redis 7。  
或者实际上它只说了“软件要求”。

我运行了 pg16，并通过 snap 在 Rocky 9 上安装了 Redis 7。  
我基本上复制了 samples/standalone.yml 并进行了编辑，添加了邮件服务器设置和一些小的更改。

当我运行 `docker ps` 或 `docker ps -a` 时，我只看到一个正在运行的容器，即本地 discourse 容器。

这听起来可能像个愚蠢的问题，但 launcher 是使用 pg 容器和 redis 容器，还是它们在使用主机的 pg 和 redis 安装？

---

<div class="post-metadata">

### Author: ![hello-smile6](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hello-smile6/32/304628_2.png) [@hello-smile6](https://meta.discourse.org/u/hello-smile6)
#### Post date: [2023年十二月21日 00:49 UTC](https://meta.discourse.org/t/does-discourse-launcher-docker-use-the-local-postgresql-and-redis-servers/289398/2 "2023-12-21T00:49:59Z")

</div>

它在主 Docker 容器内运行自己的 postgres/redis。我不认为你实际上需要在主机上安装 Postgres、Ruby 或 Redis，但我可能错了。

---

<div class="post-metadata">

### Author: ![dalu74](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dalu74/32/350170_2.png) [@dalu74](https://meta.discourse.org/u/dalu74)
#### Post date: [2023年十二月21日 01:13 UTC](https://meta.discourse.org/t/does-discourse-launcher-docker-use-the-local-postgresql-and-redis-servers/289398/3 "2023-12-21T01:13:41Z")

</div>

谢谢。

那么自然而然的下一个问题就是，“我该如何让它使用主机的 pg 和 redis”。

我知道可以让 pg 和 redis 监听在 docker0 接口上，但我也猜测一定有一种方法可以配置 discourse 容器来使用这个 docker0 的 IP 地址作为 pg 和 redis 的 IP。

我很难找到所有文档的“那个地方”。  
也许我应该开个新话题？在哪里开呢？

---

<div class="post-metadata">

### Author: ![hello-smile6](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/hello-smile6/32/304628_2.png) [@hello-smile6](https://meta.discourse.org/u/hello-smile6)
#### Post date: [2023年十二月21日 01:15 UTC](https://meta.discourse.org/t/does-discourse-launcher-docker-use-the-local-postgresql-and-redis-servers/289398/4 "2023-12-21T01:15:30Z")

</div>

是否有特定原因要使用宿主机的 PostgreSQL？Discourse 默认应自行管理 PostgreSQL 升级，因此如果您使用宿主机的 PostgreSQL，最终可能会遇到不兼容的 PostgreSQL 版本。

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2024年一月20日 01:15 UTC](https://meta.discourse.org/t/does-discourse-launcher-docker-use-the-local-postgresql-and-redis-servers/289398/5 "2024-01-20T01:15:39Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
