Last active
November 2, 2016 19:47
-
-
Save cescoferraro/f3a08f7e4c20b8243589e9d7a048877f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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