From a5d1fb7e568642e2fc30331411f61bd959eb9801 Mon Sep 17 00:00:00 2001 From: Lorenz Brun Date: Mon, 29 Jan 2018 12:01:05 +0100 Subject: [PATCH] Simple Docker-based build option This Dockerfile allows anyone with a recent version of Docker to quickly build a fully working Grafana container without any local build tooling. Pulling the sources from Git and calling `docker build .` is enough. --- Dockerfile | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000000..7b8402bfe9c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +FROM golang:1.9 +RUN go get -u github.com/golang/dep/cmd/dep +WORKDIR $GOPATH/src/github.com/grafana/grafana +COPY Gopkg.toml Gopkg.lock ./ +RUN dep ensure --vendor-only +COPY pkg pkg +RUN go install ./pkg/cmd/grafana-server +RUN go install ./pkg/cmd/grafana-cli +RUN strip $GOPATH/bin/grafana-server +RUN strip $GOPATH/bin/grafana-cli + +FROM node:8 +WORKDIR /usr/src/app/ +COPY package.json yarn.lock ./ +RUN yarn install --frozen-lockfile +ENV NODE_ENV production +COPY . ./ +RUN yarn run build + +FROM debian:stretch-slim +WORKDIR /app +ENV PATH $PATH:/app/bin +COPY --from=0 /go/bin/grafana-server ./bin/ +COPY --from=0 /go/bin/grafana-cli ./bin/ +COPY --from=1 /usr/src/app/public ./public +COPY --from=1 /usr/src/app/tools ./tools +COPY conf ./conf +CMD ["grafana-server"]