Skip to content

Instantly share code, notes, and snippets.

@mlabouardy
Created October 24, 2017 09:59
Show Gist options
  • Save mlabouardy/4cb5c53833899c0e67910bd2151cd612 to your computer and use it in GitHub Desktop.
Save mlabouardy/4cb5c53833899c0e67910bd2151cd612 to your computer and use it in GitHub Desktop.
Build Serverless Go app
FROM golang:1.9.1 AS builder
MAINTAINER mlabouardy <[email protected]>
WORKDIR /go/src/github.com/mlabouardy/Memes9Gag
RUN go get -d -v github.com/mlabouardy/9gag
COPY handler.go .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
FROM alpine:latest
RUN apk --no-cache add ca-certificates
ADD https://github.com/openfaas/faas/releases/download/0.5.1-alpha/fwatchdog /usr/bin
RUN chmod +x /usr/bin/fwatchdog
WORKDIR /root/
COPY --from=builder /go/src/github.com/mlabouardy/Memes9Gag/app .
ENV fprocess="/root/app"
CMD ["fwatchdog"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment