2022-01-07 10:27:22 -06:00
|
|
|
FROM node:16-alpine3.15 as js-builder
|
2019-11-07 09:36:40 -06:00
|
|
|
|
2021-10-28 09:41:10 -05:00
|
|
|
ENV NODE_OPTIONS=--max_old_space_size=8000
|
|
|
|
|
2019-11-07 09:36:40 -06:00
|
|
|
WORKDIR /usr/src/app/
|
|
|
|
|
|
|
|
COPY package.json yarn.lock ./
|
|
|
|
COPY packages packages
|
2021-10-26 05:08:31 -05:00
|
|
|
COPY .yarnrc.yml ./
|
|
|
|
COPY .yarn .yarn
|
|
|
|
COPY plugins-bundled plugins-bundled
|
2019-11-07 09:36:40 -06:00
|
|
|
|
2021-10-26 05:08:31 -05:00
|
|
|
RUN yarn install
|
2019-11-07 09:36:40 -06:00
|
|
|
|
2021-11-20 08:40:13 -06:00
|
|
|
COPY tsconfig.json .eslintrc .editorconfig .browserslistrc .prettierrc.js babel.config.json ./
|
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
|
|
|
|
2022-01-07 10:27:22 -06:00
|
|
|
FROM golang:1.17.6 AS go-builder
|
2020-05-04 04:59:10 -05:00
|
|
|
|
|
|
|
WORKDIR /src/grafana
|
|
|
|
|
2021-05-04 02:43:12 -05:00
|
|
|
COPY go.mod go.sum embed.go ./
|
2021-10-26 05:08:31 -05:00
|
|
|
COPY Makefile build.go package.json ./
|
|
|
|
COPY .bingo .bingo
|
2020-05-04 04:59:10 -05:00
|
|
|
COPY pkg pkg/
|
2021-05-04 02:43:12 -05:00
|
|
|
COPY cue cue/
|
2021-09-09 00:54:36 -05:00
|
|
|
COPY cue.mod cue.mod/
|
|
|
|
COPY packages/grafana-schema packages/grafana-schema/
|
2021-05-04 02:43:12 -05:00
|
|
|
COPY public/app/plugins public/app/plugins/
|
2020-05-04 04:59:10 -05:00
|
|
|
|
2021-07-27 04:50:25 -05:00
|
|
|
RUN go mod verify
|
2021-10-26 05:08:31 -05:00
|
|
|
RUN make build-go
|
2020-05-04 04:59:10 -05:00
|
|
|
|
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" \
|
2021-05-20 02:41:39 -05:00
|
|
|
"$GF_PATHS_PROVISIONING/access-control" \
|
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"
|
|
|
|
|
2021-05-04 02:43:12 -05:00
|
|
|
COPY --from=go-builder /src/grafana/bin/*/grafana-server /src/grafana/bin/*/grafana-cli bin/
|
2019-11-07 09:36:40 -06:00
|
|
|
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" ]
|