Warm tip: This article is reproduced from stackoverflow.com, please click
heroku

Migrating Heroku Project Into Another Programming Language

发布于 2020-04-11 22:16:03

I have a PHP project in my Heroku. It is a LINE Chatbot app. I want to change the code into Go. So, is it possible to 'overwrite' the existing PHP code or should I start a different project?

I've googled this kind of thing but I found zero reference regarding changing programming language in heroku projects.

I tried pushing .go script but I cannot run it with "go run" command. I wanted to pull go-getting-start from heroku, place it in the same directory as my local and push it into heroku but I was too scared.

Thank you very much

Questioner
Wildan F. Purnomo
Viewed
25
Denis Cornehl 2020-02-03 13:00

Heroku uses buildpacks to create the application image and runtime from your sourcecode.

The buildpack to use it finds via detect scripts, which mostly just check the existance of certain files (see the ones for PHP or Go.

So when you push the commit to heroku which does the switch from PHP to Go, Heroku will just use the new buildpack for the build.

You also can set the used buildpack manually or run multiple buildpacks (for example add node.js to compile static assets).