2020-12-02 11:18:49 -06:00
|
|
|
FROM node:14.15.1-slim AS js-builder
|
2019-11-07 09:36:40 -06:00
|
|
|
|
|
|
|
WORKDIR /usr/src/app/
|
|
|
|
|
|
|
|
COPY package.json yarn.lock ./
|
|
|
|
COPY packages packages
|
|
|
|
|
|
|
|
RUN yarn install --pure-lockfile
|
|
|
|
|
2020-12-02 02:15:53 -06:00
|
|
|
COPY tsconfig.json .eslintrc .editorconfig .browserslistrc .prettierrc.js ./
|
2020-02-19 08:23:54 -06:00
|
|
|
COPY public public
|
2020-04-22 04:11:19 -05:00
|
|
|
COPY tools tools
|
2019-11-07 09:36:40 -06:00
|
|
|
COPY scripts scripts
|
|
|
|
COPY emails emails
|
|
|
|
|
|
|
|
ENV NODE_ENV production
|
2020-12-02 08:49:48 -06:00
|
|
|
RUN yarn build
|
2019-11-07 09:36:40 -06:00
|
|
|
|
2020-09-02 08:51:19 -05:00
|
|
|
FROM golang:1.15.1 AS go-builder
|
2020-05-04 04:59:10 -05:00
|
|
|
|
|
|
|
WORKDIR /src/grafana
|
|
|
|
|
|
|
|
COPY go.mod go.sum ./
|
|
|
|
|
|
|
|
RUN go mod verify
|
|
|
|
|
|
|
|
COPY build.go package.json ./
|
|
|
|
COPY pkg pkg/
|
|
|
|
|
|
|
|
RUN go run build.go build
|
|
|
|
|
2020-04-24 07:03:18 -05:00
|
|
|
FROM ubuntu:20.04
|
2019-11-07 09:36:40 -06:00
|
|
|
|
|
|
|
LABEL maintainer="Grafana team <hello@grafana.com>"
|
|
|
|
EXPOSE 3000
|
|
|
|
|
|
|
|
ARG GF_UID="472"
|
|
|
|
ARG GF_GID="472"
|
|
|
|
|
|
|
|
ENV PATH="/usr/share/grafana/bin:$PATH" \
|
|
|
|
GF_PATHS_CONFIG="/etc/grafana/grafana.ini" \
|
|
|
|
GF_PATHS_DATA="/var/lib/grafana" \
|
|
|
|
GF_PATHS_HOME="/usr/share/grafana" \
|
|
|
|
GF_PATHS_LOGS="/var/log/grafana" \
|
|
|
|
GF_PATHS_PLUGINS="/var/lib/grafana/plugins" \
|
|
|
|
GF_PATHS_PROVISIONING="/etc/grafana/provisioning"
|
|
|
|
|
|
|
|
WORKDIR $GF_PATHS_HOME
|
|
|
|
|
|
|
|
COPY conf conf
|
|
|
|
|
2020-04-15 15:17:41 -05:00
|
|
|
# curl should be part of the image
|
2020-07-28 10:07:23 -05:00
|
|
|
RUN apt-get update && apt-get install -y ca-certificates curl
|
2019-11-07 09:36:40 -06:00
|
|
|
|
|
|
|
RUN mkdir -p "$GF_PATHS_HOME/.aws" && \
|
|
|
|
addgroup --system --gid $GF_GID grafana && \
|
|
|
|
adduser --uid $GF_UID --system --ingroup grafana grafana && \
|
|
|
|
mkdir -p "$GF_PATHS_PROVISIONING/datasources" \
|
|
|
|
"$GF_PATHS_PROVISIONING/dashboards" \
|
|
|
|
"$GF_PATHS_PROVISIONING/notifiers" \
|
2020-12-03 07:17:40 -06:00
|
|
|
"$GF_PATHS_PROVISIONING/plugins" \
|
2019-11-07 09:36:40 -06:00
|
|
|
"$GF_PATHS_LOGS" \
|
|
|
|
"$GF_PATHS_PLUGINS" \
|
|
|
|
"$GF_PATHS_DATA" && \
|
|
|
|
cp conf/sample.ini "$GF_PATHS_CONFIG" && \
|
|
|
|
cp conf/ldap.toml /etc/grafana/ldap.toml && \
|
|
|
|
chown -R grafana:grafana "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING" && \
|
|
|
|
chmod -R 777 "$GF_PATHS_DATA" "$GF_PATHS_HOME/.aws" "$GF_PATHS_LOGS" "$GF_PATHS_PLUGINS" "$GF_PATHS_PROVISIONING"
|
|
|
|
|
|
|
|
COPY --from=go-builder /src/grafana/bin/linux-amd64/grafana-server /src/grafana/bin/linux-amd64/grafana-cli bin/
|
|
|
|
COPY --from=js-builder /usr/src/app/public public
|
|
|
|
COPY --from=js-builder /usr/src/app/tools tools
|
|
|
|
|
|
|
|
COPY packaging/docker/run.sh /
|
|
|
|
|
|
|
|
USER grafana
|
|
|
|
ENTRYPOINT [ "/run.sh" ]
|