Skip to content

Instantly share code, notes, and snippets.

@cescoferraro
Last active November 2, 2016 19:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cescoferraro/f3a08f7e4c20b8243589e9d7a048877f to your computer and use it in GitHub Desktop.
Save cescoferraro/f3a08f7e4c20b8243589e9d7a048877f to your computer and use it in GitHub Desktop.
meta:
project: {{.Name}}
default: binary
env=vars:
variables: [VERSION=0.0.1]
mount=source:
bind: .
path: /go/src/{{.Path}}
mount=dist:
bind: ./dist/bin/
path: /go/bin/
image=binary-builder:
image: cescoferraro/golang
tags: ["latest"]
pull: "always"
job=binary:
use: binary-builder
mounts: [source, dist]
working-dir: /go/src/{{.Path}}
command: go build -i -o /go/bin/goapp
image=production:
image: cescoferraro/{{.Name}}
tags: ["{env.VERSION:}"]
context: .
dockerfile: Dockerfile
depends: [binary, vars]
job=preview:
use: production
description: "Preview the production image"
job=watch:
use: binary-builder
interactive: true
net-mode: host
working-dir: /go/src/{{.Path}}
depends: [vars]
command: reflex -r '\.go' -s -- go run main.go
mounts: [source]
description: "Watch for code changes and run main file"
FROM alpine:3.4
RUN apk add --no-cache ca-certificates apache2-utils
ADD ./dist/bin/goapp /bin/goapp
CMD ["/bin/goapp"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment