LoginSignup
2
2

More than 5 years have passed since last update.

SpringBootのアプリをherokuにアップしてみた

Posted at

前回の続き

SpringBootで作成したアプリをherokuにアップしてみた。

環境

  • Mac High Sierra 10.13.5
  • Java 1.8.0_11
  • Maven 3.5.4
  • springboot 2.0.3

手順

  • githubとherokuを連携
    herokuログイン後、アプリケーションを選択し、Deploy→Deployment methodでgithubを選択。App connected to GitHub で自分のgithubのリポジトリを探して、連携する。

  • Procfileの設定
    herokuの手順を参考に、Procfileを設定。

Procfile
web: java -Dserver.port=$PORT -jar target/[mvnで作成したjarファイル]
  • system.propertiesの設定
    javaのバージョンを指定。
system.properties
java.runtime.version=1.8

あとは、ローカル→githubにpushすれば、自動でherokuに連携される。
herokuにうまく反映されたか確認するにはアプリケーションのOverviewを見れば、OK。
うまく行けば、「Build succeeded」と表示される。

2
2
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
2
2