LoginSignup
10
5

More than 5 years have passed since last update.

[Heroku] productionの環境変数を.envファイルで設定する方法

Last updated at Posted at 2019-04-26

■ アプリケーション直下に.envファイルを用意する

terminal
$ touch .env

■ .envファイル内に環境変数をセットする

.env
ENVIRONMENT_VARIABLE=hogehoge

■ heroku-config をインストールする

terminal
$ heroku plugins:install heroku-config
Installing plugin heroku-config... installed v1.5.3

■ .envファイル内の環境変数をherokuに適用する

terminal
$ heroku config:push
Successfully wrote settings to Heroku!
10
5
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
10
5