-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdockerfile.grafana
30 lines (21 loc) · 1.31 KB
/
dockerfile.grafana
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Use the official Grafana image as the base image
FROM grafana/grafana:latest
USER root
RUN apk update && apk add netcat-openbsd dos2unix
COPY docker/grafana/entrypoint-grafana.sh /usr/bin/entrypoint-grafana.sh
RUN chmod +x /usr/bin/entrypoint-grafana.sh && dos2unix /usr/bin/entrypoint-grafana.sh
USER grafana
# Create directories for provisioning
RUN mkdir -p /etc/grafana/provisioning/dashboards /var/lib/grafana/dashboards
# Copy datasource configuration
COPY docker/grafana/grafana-datasource-graphite.yaml /etc/grafana/provisioning/datasources/graphite_datasource.yaml
# Copy dashboard provisioning configuration
COPY docker/grafana/dashboard.yaml /etc/grafana/provisioning/dashboards/dashboard.yaml
# Copy dashboards
COPY docker/grafana/grafana-dashboard-telegraf.json /var/lib/grafana/dashboards/telegraf_dashboard.json
COPY docker/grafana/grafana-dashboard-gatling.json /var/lib/grafana/dashboards/gatling_dashboard.json
# Set environment variables to enable provisioning
ENV GF_DASHBOARDS_JSON_ENABLED="true"
ENV GF_DASHBOARDS_JSON_PATH="/var/lib/grafana/dashboards"
ENV GF_DATASOURCES_PATH="/etc/grafana/provisioning/datasources"
ENTRYPOINT ["/usr/bin/entrypoint-grafana.sh", "graphite.loadtest", "2003", "--", "grafana-server", "--homepath=/usr/share/grafana", "--config=/etc/grafana/grafana.ini", "--packaging=docker"]