聲明在先!此方法乃去年成功架設過程寫下的,然而之後某天論壇GG後,我用同樣方法已經無法再次順利架設了,所以本篇只是留存紀錄而已...😂
參考: https://tomthegreat.com/blog/setting-up-discourse-on-a-synology-with-docker/
Download the Discourse Docker Image
Login to the Synology via SSH. Once logged in, change to the root user to execute the remainder of the commands.
sudo -i
Clone the official Discourse Docker image to your Docker folder for Discourse.
git clone https://github.com/discourse/discourse_docker.git /volume1/docker/discourse-test
Create a symbolic link between the Docker folder for Discourse and where Discourse installer wants everything to be.
ln -s /volume1/docker/discourse-test /var/discourse-test
# PS如果要解除link請用/var/discourse-test比較安全
Create missing folders so that it doesn't error out on the build.
mkdir /var/discourse-test/shared/standalone
mkdir /var/discourse-test/shared/standalone/log/
mkdir /var/discourse-test/shared/standalone/log/var-log
Copy over the standalone sample container to the correct location for setup, and at the same time rename the file to what you want to call the container.
cp /var/discourse-test/samples/standalone.yml /var/discourse-test/containers/discourse.yml
編輯discourse.yml符合你的環境配置,可用指令或從dsm桌面的文字編輯器編輯
nano /var/discourse-test/containers/discourse.yml
啟動建置工作,這步驟會花上較多時間,視硬體能力不同而有差
/var/discourse-test/launcher rebuild discourse
順利完成後,打開瀏覽器輸入網址看有沒有畫面,成功的話往下一步註冊帳號
註冊帳號需要有效的EMAIL,前面MAIL SMTP資訊如果有誤造成無法收信,那便需要用指令手動啟用管理員帳號了
./launcher enter discourse
rake admin:create
以上步驟有點問題,最後一個命令有錯誤
如果修改discourse.yaml後,需要重建app
sudo /var/discourse-test/launcher rebuild discourse
但是,如果只更動SMTP設定可以不必重建,不然很花時間。 If you change just SMTP settings, you can do just this to apply them without doing a full rebuild:
cd /var/discourse
./launcher destroy discourse
./launcher start discourse