Herokuのアドオンの Heroku Scheduler は非常に便利なのですが、Dockerで構築した Container Registry で利用するには注意があります。
--type=web のコンテナしか実行されません
Heroku Scheduler
でのジョブの登録時に type
の指定がないから変だと思ったのですよね・・・。
以下のコマンドでデプロイしたコンテナを Heroku Scheduler
は参照します。
heroku container:push web --app [APP_NAME]
heroku container:release web --app [APP_NAME]
以下のように worker
を指定したものは無視されます。
ログには指定したコマンドの実行が1行出力されるだけでエラーも出力されません。
heroku container:push worker --app [APP_NAME]
heroku container:release worker --app [APP_NAME]
おまけ
以下は、Herokuの公式ドキュメントの引用です。
2019年9月8日時点のものです。
Heroku Scheduler and Container Registry
If you are using Heroku Scheduler and Container Registry as your deployment method, your task must be accessible from the web image. There is no way to specify a non-web image for task execution.