1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Volto をディプロイする

Last updated at Posted at 2020-01-08

注意

このドキュメントは記載途中です。テスト・検証前のドキュメントのみを見て書いています。

前提

  • Plone 5.2 on Python 3
  • plone.restapi 最新版
  • Volto 4 (alpha)
  • pm2 でディプロイ

Ploneのセットアップ

ここでは詳しく書きません。必要な項目のみを記載

Ploneインスタンス

Ploneインスタンスを作る (id: Plone とする方が良いかな?)

plone.restapi

  • インストールバージョン Version 5.0.2 以降(なるべく最新版がいい)
  • アドオン(add-on) でplone.restapiで有効化

nginxの設定

TBD

Node環境の設定

NVM

lts/erbium をインストール

$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
$ nvm install --lts  
$ nvm use lts/erbium

yarn

$ curl -o- -L https://yarnpkg.com/install.sh | bash

enable nvvm and yarn

$ source ~/.bashrc

Voltoのbuild

パッケージを取得

独自のレポジトリから、Voltoのアプリをgit cloneする

build

$ nvm use lts/erbium
$ yarn
$ yarn build

参考: https://github.com/plone/volto-starter-kit

pm2で動作

参考: https://github.com/plone/volto/blob/deployment-docs/docs/source/07-deploying/02-pm2.md
参考2: https://community.plone.org/t/volto-deployment-options/7458/8

server.config.json

server.config.json
module.exports = {
  apps: [
      {
        script: './build/server.js',
        "env": {
            NODE_ENV: 'production',
        },
        name: 'volto',
        cwd: './',

      },
      {
        script: '/srv/plone/zinstance/bin/instance',
        args: 'console',
        name: 'plone-api',
        cwd: '/srv/plone/zinstance',
        interpreter: '/srv/plone/zinstance/bin/python',
      },
  ],
};
  • 20200307 NODE_ENV を追加(pm2で実行時にstyled-componentが新しいclassを付けるのを防ぐ)

pm2インストール

$ npm install -g pm2

pm2起動

$ pm2 start server.config.js

環境変数(env)

.env ファイルを作成

.env
RAZZLE_API_PATH=http://PLONE_HOST/api

環境変数の有効化

$ yarn build
$ pm2 restart all
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?