In this example, we’ll walk through an example of enabling preview environments for a simple Go application, built via a cloud-native buildpack. The sample repository can be found here.
porter.yaml file for this application is as follows:
version: "v1" resources: - name: "go-sample" source: name: "web" config: build: method: "pack" values: container: command: "go-getting-started" port: 8080 env: normal: BPE_PORT: "8080" BP_KEEP_FILES: "static/*"
source: By only setting the
web, Porter will deploy this as a
config.build: specifying the
packinstructs Porter to build this application using cloud-native buildpacks.
config.values: here, we set common configuration settings, such as the start command, the port that the application runs on, and environment variables for the application.