Flamingo in Production¶
The benefit from go is that you build/compile a standalone binary without any external dependencies.
We recommend that you do so in a proper continuous integration pipeline that runs all your tests before with
go test -race -vet=all ./...
Make sure to bundle the templates and config files. For example in a tarball/zipball or a Docker image
Check the file
example/dist/Dockerfile for an example Dockerfile that you can use in your application:
# Example Dockerfile for Flamingo/Go based Projects # Builder FROM golang:alpine AS builder RUN apk update && apk add --no-cache ca-certificates tzdata git && update-ca-certificates COPY . /app RUN cd /app && CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o app . # Final image FROM scratch # add timezone data and ssl root certificates COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ # add artifacts #ADD config /config # add binary COPY --from=builder /app/app /app ENTRYPOINT ["/app"] CMD ["serve"]
- Run is behind a Load Balancer like Nginx or a Kubernetes Ingress
- Upcoming: We are planning to include "Caddy" soon, so that there would be support for Auto TLS (Letsencrypt) and config/Caddyfile support.
For metrics support and to push tracing informations to Jaeger/Zipkin Flamingo uses opencensus. Read more about Opencensus