# 在隔离的 CentOS 7 服务器上安装 Discourse

**URL:** <https://meta.discourse.org/t/install-discourse-on-an-isolated-centos-7-server/73538>\
**Category:** Sysadmins\
**Tags:** how-to, install\
**Created:** [2017年十一月6日 17:16 UTC](https://meta.discourse.org/t/install-discourse-on-an-isolated-centos-7-server/73538 "2017-11-06T17:16:03Z")\
**Posts on this page:** 1\
**Showing post:** 24

<div class="post-metadata">

**Author:** ![ssvenn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ssvenn/32/86740_2.png) [@ssvenn](https://meta.discourse.org/u/ssvenn)\
**Post date:** [2022年七月5日 11:15 UTC](https://meta.discourse.org/t/install-discourse-on-an-isolated-centos-7-server/73538/24 "2022-07-05T11:15:17Z")

</div>

我尝试了另一次升级，看起来在某个时候 web.template.yml 中添加了一个新的“yarn install”部分，这在隔离环境中会中断。

```plaintext
- exec:
      cd: $home
      cmd:
        - "[! -d 'node_modules'] || su discourse -c 'yarn install --production &amp;&amp; yarn cache list'"

```

比较新旧容器的内容时，看起来新容器的 /usr/local/share/.cache/yarn/v6 中有很多缓存的 yarn 包，而旧容器中则没有，我猜所有必需的 node.js 以前都包含在基础镜像中，但现在它们在重建过程中被更新了？

我将尝试以与复制 ruby 缓存相同的方式复制 yarn 缓存，看看是否能让 yarn 使用构建框中的缓存包。

---

_[View the full topic](https://meta.discourse.org/t/install-discourse-on-an-isolated-centos-7-server/73538)._
