0
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.

Laravel5.2 Herokuにデプロイ

Last updated at Posted at 2016-07-28

##やること
Laravel5.2でHerokuにデプロイ
Deploy Heroku [Laravel 5.2.*] を参考に淡々と実行するだけで、Laravel5.2ならデプロイできる。
**Laravel5.1の場合は不明です。

##環境
デプロイアプリ:Laravel 5.2
開発環境:Laravel/homestead v0.5.0
ローカル環境:Windows10
ターミナル:GitBash + ConEmu
その他:Heroku Toolbeltをインストール済

##手順
1.対象アプリのディレクトリでgit init
2.buildpacksをセット
3.APP Bootを作成
4.Procfileを作成
5.本番環境の環境変数を設定
6.Herokuにpush

1.terminal
git init
2.terminal
heroku buildpacks:set https://github.com/heroku/heroku-buildpack-multi.git
curl -s https://gist.githubusercontent.com/3runoDesign/7c4c8652c7c4543c9a3b/raw/5bb673135c6498abf8512b623e3d362efcfbd59c/buildpacks > .buildpacks
3.terminal
curl -s https://gist.githubusercontent.com/3runoDesign/7c4c8652c7c4543c9a3b/raw/bdc5e201a7949c6d90c53ee2fd12dd164a173247/app_boot.sh > app_boot.sh
4.terminal
curl -s https://gist.githubusercontent.com/3runoDesign/7c4c8652c7c4543c9a3b/raw/2dec75e90b8d8c9ac165b412ec7d2b18861136c9/Procfile > Procfile
4.composer.json
    "scripts": {
         ......
        "post-install-cmd": [
            "php artisan clear-compiled" ->追加
        ],
        "post-update-cmd": [
            "php artisan clear-compiled" ->追加
        ]
    },
5.terminal
heroku config:set APP_ENV=production
heroku config:set APP_KEY=$(php artisan --no-ansi key:generate --show)
heroku config:set APP_DEBUG=false
6.terminal
git add .
git commit -m "自由なコミットメッセージ"
git push heroku master

##参考
以下の記事を見るだけでたぶん大丈夫。
Deploy Heroku [Laravel 5.2.*]

0
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
0
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?