Running Go applications on Nodion
Learn more about how to run Go applications and frameworks like Gin on Nodion
Contents
Create a new application
To get started you can simply create a new application after signing in. If you simply want to try out our platform you can use one of our starter templates to get up and running quickly.
Deploying with Buildpacks
Buildpacks will automatically detect that you are running a Go application if you have a go.mod
, Gopkg.lock
, Godeps/Godeps.json
, vendor/vendor.json
, glide.yaml
file in the root directory of your application or if your src
directory contains a Go file. Please provide the desired Go version either as a GOVERSION
environment variable or set it through the go.mod or Godeps.json file, the Go Buildpack will install all dependencies as well as the specified Go version.
It's necessary to set a PORT
Environment Variable within your application settings. If this is not set, our load balancing system is not able to redirect to your application and an error will occur.
Release stage
If you need to run certain tasks when deploying you can use the release stage of the Procfile. The command provided there will be run right before spawning the new containers of that deployment. If you are using Flyway you could use something like this:
web: app
release: gin migrateProcfile
Additional Packages
We support multiple Buildpack Builders, depending on which Builder you chose there are different packages pre-installed. You can use additional Buildpacks, like the FFmpeg Buildpack to install a specific package. In general, all Builders that are supported by Nodion are based on Ubuntu. That means you can also install any package by adding a Buildpack called apt and creating an Aptfile
to provide a list of packages.
Connecting to a Database
You can create PostgreSQL or MariaDB instances with our Managed Database service and attach them directly to your application. Database credentials can be added through Environment Variables.