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.

Nuxtをherokuにデプロイするコマンドメモ

Last updated at Posted at 2020-06-09

Nuxtをherokuにデプロイするコマンドメモ

Heroku Gitを利用するパターンです。
ほぼドキュメントの写し。メモ。

手順

herokuのCLIインストール

npm install -g heroku
heroku login
ブラウザ立ち上がるのでログイン

リモートリポジトリを作成したappのリモートリポジトリに

cd /path/to/yourProject
heroku git:remote -a subscription-switcher-demo

Nuxtプロジェクトデプロイ用の設定

# devDependenciesをインストールする設定
heroku config:set NPM_CONFIG_PRODUCTION=false

# 0.0.0.0のListen
heroku config:set HOST=0.0.0.0

# productionモードに設定
heroku config:set NODE_ENV=production

Propcfileの作成

vi Procfile

以下の一行を追加
web: nuxt start

Heroku Gitにプッシュ 勝手にデプロイされる

git add .
git commit -am "comment here"
git push heroku master

おまけ master以外のブランチをデプロイしたいとき

git push heroku [branch_to_deploy]:master

参考

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?