Procfilefor defining how your app start
The Go buildpack is used when an application meets one of the following requirements:
- has a
Godeps/Godeps.jsonfile, identifying the application as being managed by godep;
- has a
vendor/vendor.jsonfile, identifying the application as being managed by govendor;
- has a
srcdirectory, which has sub directories, contains one or more
.gofiles, identifying the application as being managed by
Define a Procfile
Procfile, a text file in the root directory of your application, to explicitly declare what command should be executed to start your app.
Procfile in the example app you deployed looks like this:
The command used here,
bin/myproject is the compiled binary of the getting started app. The build process installs compiled binaries into the app's
module github.com/heroku/go-getting-started go 1.12 require ( github.com/gin-gonic/gin v0.0.0-20150626140855-4cc2de6207f4 github.com/heroku/x v0.0.0-20171004170240-705849e307dd github.com/manucorporat/sse v0.0.0-20150604091100-c142f0f1baea // indirect github.com/mattn/go-colorable v0.0.0-20150625154642-40e4aedc8fab // indirect github.com/mattn/go-isatty v0.0.0-20150814002629-7fcbc72f853b // indirect github.com/stretchr/testify v1.3.0 // indirect golang.org/x/net v0.0.0-20150629084131-d9558e5c97f8 // indirect gopkg.in/bluesuncorp/validator.v5 v5.9.1 // indirect )
go.mod file is used by Go tool and specifies both the dependencies that are required to build your application and the build configuration used to compile the application.
When an app is deployed, Backery reads this file, installs an appropriate Go version and compiles your code using
go install . .