# Discourse 中国区部署问题

**URL:** <https://www.isharkfly.com/t/discourse/17011>\
**Category:** Discourse\
**Tags:** discourse\
**Created:** [March 3, 2025, 6:54pm UTC](https://www.isharkfly.com/t/discourse/17011 "2025-03-03T18:54:41Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![honeymoose](https://www.isharkfly.com/user_avatar/www.isharkfly.com/honeymoose/32/20796_2.png) [@honeymoose](https://www.isharkfly.com/u/honeymoose)\
**Post date:** [March 3, 2025, 6:54pm UTC](https://www.isharkfly.com/t/discourse/17011/1 "2025-03-03T18:54:41Z")

</div>

## 我的情况：

1. 几个月前我在中国大陆的Linux服务器部署了discourse，并且运行正常。我添加了`- "templates/web.china.template.yml"`
2. 但是今天我尝试再次rebuild的时候，会提示`Error response from daemon: Get "https://registry-1.docker.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)`

---

<div class="post-metadata">

**Author:** ![honeymoose](https://www.isharkfly.com/user_avatar/www.isharkfly.com/honeymoose/32/20796_2.png) [@honeymoose](https://www.isharkfly.com/u/honeymoose)\
**Post date:** [March 3, 2025, 6:57pm UTC](https://www.isharkfly.com/t/discourse/17011/2 "2025-03-03T18:57:52Z")

</div>

使用docker 拉镜像的时候，出现下面的错误：

> net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)

因为在下载官方镜像点的镜像国内访问速度太慢，所以报错，使用加速器就可以解决这个问题

首先打开配置文件daemon.json，centos上安装后有此文件，但是ubuntu上需要自己创建文件：

vim /etc/docker/daemon.json

在文件中加入：

```auto
    {
        "registry-mirrors":["https://repo-docker-public.isharkfly.com/"]
    }

```

原来上面这个配置文件的地址是清华大学的，现在这个地址已经不好用了。

我们自己用 Nexus 做了一个 Docker 的镜像。

然后重启守护进程：

```
sudo systemctl daemon-reload
sudo systemctl restart docker

```

等于是让你的 Docker 容器换个镜像地址下载。

也不知道具体那个镜像好用，所以顺便给 Google 搜索下。

参考下下面的链接看看：[国内的 Docker Hub 镜像加速器，由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized · GitHub](https://gist.github.com/y0ngb1n/7e8f16af3242c7815e7ca2f0833d3ea6)

---

<div class="post-metadata">

**Author:** ![luobo](https://www.isharkfly.com/user_avatar/www.isharkfly.com/luobo/32/15604_2.png) [@luobo](https://www.isharkfly.com/u/luobo)\
**Post date:** [March 4, 2025, 4:14am UTC](https://www.isharkfly.com/t/discourse/17011/3 "2025-03-04T04:14:09Z")

</div>

国内机器推荐直接挂全局代理，不然可能会遇到GitHub插件无法下载，容器拉取失败之类的。

---

<div class="post-metadata">

**Author:** ![honeymoose](https://www.isharkfly.com/user_avatar/www.isharkfly.com/honeymoose/32/20796_2.png) [@honeymoose](https://www.isharkfly.com/u/honeymoose)\
**Post date:** [March 4, 2025, 1:35pm UTC](https://www.isharkfly.com/t/discourse/17011/4 "2025-03-04T13:35:34Z")

</div>

是呀，这个容器拉取的问题是一个大问题。

---

<div class="post-metadata">

**Author:** ![VegaMonika](https://www.isharkfly.com/user_avatar/www.isharkfly.com/vegamonika/32/14424_2.png) [@VegaMonika](https://www.isharkfly.com/u/VegaMonika)\
**Post date:** [March 5, 2025, 3:01am UTC](https://www.isharkfly.com/t/discourse/17011/5 "2025-03-05T03:01:16Z")

</div>

我还是觉得部署在 台湾省和香港省这2地方即可

---

<div class="post-metadata">

**Author:** ![Dummy](https://www.isharkfly.com/letter_avatar_proxy/v4/letter/d/7c8e57/32.png) [@Dummy](https://www.isharkfly.com/u/Dummy)\
**Post date:** [March 5, 2025, 3:09am UTC](https://www.isharkfly.com/t/discourse/17011/6 "2025-03-05T03:09:44Z")

</div>

部署在内地就算了。

要是想安装主题插件之类都不能安装，只能本地安装；

rebuild也需要重复好几次 😅。

---

<div class="post-metadata">

**Author:** ![hex](https://www.isharkfly.com/user_avatar/www.isharkfly.com/hex/32/21953_2.png) [@hex](https://www.isharkfly.com/u/hex)\
**Post date:** [March 5, 2025, 3:16pm UTC](https://www.isharkfly.com/t/discourse/17011/7 "2025-03-05T15:16:35Z")

</div>

主要是有人在 Discourse 的官方问了这个问题。

所以想就拿着这里来讨论下，发现主要的问题还是在编译使用的包下载不下来。

我们自己也有一个 Nexus 的仓库管理，所以想着能不能给做个镜像。

但我可能感觉还比较困难，首先这个仓库管理也是部署在外面的，另外大数据传输可能会被中断。

但觉得也可以尝试下吧。

---

<div class="post-metadata">

**Author:** ![honeymoose](https://www.isharkfly.com/user_avatar/www.isharkfly.com/honeymoose/32/20796_2.png) [@honeymoose](https://www.isharkfly.com/u/honeymoose)\
**Post date:** [March 5, 2025, 3:23pm UTC](https://www.isharkfly.com/t/discourse/17011/8 "2025-03-05T15:23:21Z")

</div>

太难了。

想拉个服务器测试下，结果这价格实在是太不好看了吧。

 ![2025-03-05_10-22-20](https://com-isharkfly-discourse.s3.dualstack.us-east-2.amazonaws.com/com-isharkfly-www/discourse-uploads/original/3X/2/5/25bf13b7113dbefd3070593a3f0f0f066c1b4a39.jpeg)

在外面随便拉个 VPS 都比这个便宜不是。

---

<div class="post-metadata">

**Author:** ![Dummy](https://www.isharkfly.com/letter_avatar_proxy/v4/letter/d/7c8e57/32.png) [@Dummy](https://www.isharkfly.com/u/Dummy)\
**Post date:** [March 6, 2025, 1:13am UTC](https://www.isharkfly.com/t/discourse/17011/9 "2025-03-06T01:13:44Z")

</div>

可以用阿里云的试用三个月啊

---

<div class="post-metadata">

**Author:** ![Dummy](https://www.isharkfly.com/letter_avatar_proxy/v4/letter/d/7c8e57/32.png) [@Dummy](https://www.isharkfly.com/u/Dummy)\
**Post date:** [March 6, 2025, 1:14am UTC](https://www.isharkfly.com/t/discourse/17011/10 "2025-03-06T01:14:10Z")

</div>

加油 👍

---

<div class="post-metadata">

**Author:** ![hex](https://www.isharkfly.com/user_avatar/www.isharkfly.com/hex/32/21953_2.png) [@hex](https://www.isharkfly.com/u/hex)\
**Post date:** [March 7, 2025, 2:55pm UTC](https://www.isharkfly.com/t/discourse/17011/11 "2025-03-07T14:55:32Z")

</div>

> [@Dummy](#):
>
> 阿里云的试用三个月啊

整个 1 个月的地点在成都的服务器试试看。

 ![2025-03-07_09-53-29](https://com-isharkfly-discourse.s3.dualstack.us-east-2.amazonaws.com/com-isharkfly-www/discourse-uploads/original/3X/0/2/02cc1a4375fef425c3d51b366fc12bcafe8dc870.jpeg)

---

<div class="post-metadata">

**Author:** ![sober](https://www.isharkfly.com/user_avatar/www.isharkfly.com/sober/32/13356_2.png) [@sober](https://www.isharkfly.com/u/sober)\
**Post date:** [March 8, 2025, 8:44am UTC](https://www.isharkfly.com/t/discourse/17011/12 "2025-03-08T08:44:00Z")

</div>

支持最新discourse docker镜像版本，支持中国网络使用，后期新镜像也是调整版本号

```auto
registry.cn-wulanchabu.aliyuncs.com/docker-hub-china/discourse-base:2.0.20250226-0128

```

目前比较稳定的方案

[https://www.zeppos.tech/t/topic/12328?u=sober](https://www.zeppos.tech/t/topic/12328?u=sober)

搭建好的discourse docker的资源，中国内直接使用，拉满你的网络带宽，有其它版本需求，可以留言，目前升级最高的版本，最近有些忙，没有同步最新版本

```auto
registry.cn-wulanchabu.aliyuncs.com/docker-hub-china/discourse-base:2.0.20250129-0720

```

修改方法

 ![image](https://cdn.isharkfly.com/com-isharkfly-www/discourse-uploads/original/3X/2/1/211eed6c5d9c669a88a7abb5e8787b291d88b0c9.png)

中国区服务器部署方法，可以讨论，中国网络，解决了所有中国网络有限制的资源依赖库加速，拉满你的网络带宽，还有低成本服务器部署方案。

使用web\_only.yml data.yml，分离数据库和web网页，相对app.yml实现类似rebuild重构更新不停论坛服务方案

---

<div class="post-metadata">

**Author:** ![Kokomi](https://www.isharkfly.com/user_avatar/www.isharkfly.com/kokomi/32/16765_2.png) [@Kokomi](https://www.isharkfly.com/u/Kokomi)\
**Post date:** [July 27, 2025, 5:14pm UTC](https://www.isharkfly.com/t/discourse/17011/13 "2025-07-27T17:14:58Z")

</div>

谢谢你的镜像😊  
另外你的论坛是关闭了注册吗

---

<div class="post-metadata">

**Author:** ![sober](https://www.isharkfly.com/user_avatar/www.isharkfly.com/sober/32/13356_2.png) [@sober](https://www.isharkfly.com/u/sober)\
**Post date:** [July 27, 2025, 11:46pm UTC](https://www.isharkfly.com/t/discourse/17011/14 "2025-07-27T23:46:35Z")

</div>

论坛通过邮件申请注册，是邀请式的，不对游客开放

---

<div class="post-metadata">

**Author:** ![upsolution](https://www.isharkfly.com/user_avatar/www.isharkfly.com/upsolution/32/21727_2.png) [@upsolution](https://www.isharkfly.com/u/upsolution)\
**Post date:** [July 29, 2025, 2:00pm UTC](https://www.isharkfly.com/t/discourse/17011/15 "2025-07-29T14:00:24Z")

</div>

discourse国内服务器安装不成功，我之前就发现这个问题，后面换了国外服务器解决了

---

<div class="post-metadata">

**Author:** ![whitewatercn](https://www.isharkfly.com/user_avatar/www.isharkfly.com/whitewatercn/32/2131_2.png) [@whitewatercn](https://www.isharkfly.com/u/whitewatercn)\
**Post date:** [August 4, 2025, 4:01am UTC](https://www.isharkfly.com/t/discourse/17011/16 "2025-08-04T04:01:22Z")

</div>

> [@honeymoose](#):
>
> 原来上面这个配置文件的地址是清华大学的，现在这个地址已经不好用了。

前一段时间国内禁用了各大docker镜像，也不知道图个什么

- [https://linux.do/t/topic/107558](https://linux.do/t/topic/107558)

---

<div class="post-metadata">

**Author:** ![hex](https://www.isharkfly.com/user_avatar/www.isharkfly.com/hex/32/21953_2.png) [@hex](https://www.isharkfly.com/u/hex)\
**Post date:** [August 4, 2025, 3:50pm UTC](https://www.isharkfly.com/t/discourse/17011/17 "2025-08-04T15:50:12Z")

</div>

不清楚具体的原因。

可能还是内容上面的原因吧？

对于镜像，任何人可以用任何一个文档工具框架做很多内容然后打包成镜像进行下载。

下载的镜像可以直接跑，然后删除或者直接分发。

个人感觉是在这种方式下无法对内容的传输进行控制。

所以可能简单粗暴点直接给禁用了。

---

<div class="post-metadata">

**Author:** ![sober](https://www.isharkfly.com/user_avatar/www.isharkfly.com/sober/32/13356_2.png) [@sober](https://www.isharkfly.com/u/sober)\
**Post date:** [September 12, 2025, 9:15am UTC](https://www.isharkfly.com/t/discourse/17011/18 "2025-09-12T09:15:37Z")

</div>

![image](https://cdn.isharkfly.com/com-isharkfly-www/discourse-uploads/original/3X/0/5/05dc13c8bd603e99ddf9c035d6495cf7ebb56407.png)这个方案可以解决国内的快速加速方案

---

<div class="post-metadata">

**Author:** ![sober](https://www.isharkfly.com/user_avatar/www.isharkfly.com/sober/32/13356_2.png) [@sober](https://www.isharkfly.com/u/sober)\
**Post date:** [September 12, 2025, 9:17am UTC](https://www.isharkfly.com/t/discourse/17011/19 "2025-09-12T09:17:08Z")

</div>

![image](https://cdn.isharkfly.com/com-isharkfly-www/discourse-uploads/original/3X/b/b/bb6481f2925426a942df60232e0c026fd8f2814e.png)这个基本可以解决中国区网络加速问题，把带宽拉满

[discourse预编译功能让rebuild时间从45分钟降到3分钟 - forum / discourse - tech茶水间](https://www.zeppos.tech/t/topic/13968)

中国区最新discourse镜像

 ![image](https://cdn.isharkfly.com/com-isharkfly-www/discourse-uploads/original/3X/f/1/f1f04c7b2dda698c38b440093e999dc66ba96a94.png)
