LoginSignup
13
10

More than 5 years have passed since last update.

heroku + python + flask + selenium + headless-chrome を本番公開

Last updated at Posted at 2018-05-26

この環境でいろいろとやる機会があったので、いっそメモっとこうと思いました。
Local で動いてる前提です。

heroku に chromedriver と chrome を追加する

heroku create して push した後、次の Buildpacks を追加する

terminal
$ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-chromedriver.git
$ heroku buildpacks:set https://github.com/heroku/heroku-buildpack-google-chrome.git

念の為に heroku の管理画面を確認する

heroku > personal > [project] > Settings > Buildpacks
スクリーンショット 2018-05-27 6.17.44.png

これが追加されていれば成功。(若干ディレイがある)
追加されない場合は管理画面から入れる

あとは再度 push すれば公開されます。
VPS などで最初から環境構築すると chromedriver 周りの設定がめんどいので、
heroku だと簡単です。

13
10
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
13
10