Skip to content

Commit b1badf0

Browse files
authored
Merge pull request #3 from grafana/remoteRendering
updates to better support remote rendering
2 parents 718a903 + a3cfef5 commit b1badf0

File tree

8 files changed

+600
-39
lines changed

8 files changed

+600
-39
lines changed

Dockerfile

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
FROM node:10 AS base
2+
3+
WORKDIR /usr/src/app
4+
5+
RUN apt-get update && \
6+
apt-get install -yq gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 \
7+
libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 \
8+
libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 \
9+
libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 \
10+
fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst ttf-freefont \
11+
ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget && \
12+
wget https://github.com/Yelp/dumb-init/releases/download/v1.2.1/dumb-init_1.2.1_amd64.deb && \
13+
dpkg -i dumb-init_*.deb && rm -f dumb-init_*.deb && \
14+
apt-get clean && apt-get autoremove -y && rm -rf /var/lib/apt/lists/*
15+
16+
FROM base as build
17+
18+
RUN npm install -g typescript
19+
20+
COPY . ./
21+
22+
RUN yarn install --pure-lockfile && \
23+
yarn run build
24+
25+
EXPOSE 8081
26+
27+
CMD [ "yarn", "run", "dev" ]
28+
29+
FROM base
30+
31+
COPY --from=build /usr/src/app/node_modules node_modules
32+
COPY --from=build /usr/src/app/build build
33+
COPY --from=build /usr/src/app/proto proto
34+
35+
EXPOSE 8081
36+
37+
ENTRYPOINT ["dumb-init", "--"]
38+
39+
CMD ["node", "build/app.js", "server", "--port=8081"]

README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,27 @@ Nodejs v8+ installed.
1010

1111
- git clone into Grafana external plugins folder.
1212
- yarn install --pure-lockfile
13-
- npm run build
13+
- yarn run build
1414
- restart grafana-server , it should log output that the renderer plugin was found and started.
1515
- To get more logging info update grafana.ini section [log] , key filters = rendering:debug
16+
17+
18+
# Remote Rendering Docker image
19+
20+
A dockerfile is provided for deploying the remote-image-renderer in a container.
21+
You can then configure your Grafana server to use the container via the
22+
```
23+
[rendering]
24+
server_url=http://renderer:8081/render
25+
```
26+
config setting in grafana.ini
27+
28+
A docker-compose example is provided in docker/
29+
to launch
30+
31+
```
32+
cd docker
33+
docker-compose up
34+
```
35+
36+

docker/docker-compose.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: '2'
2+
3+
services:
4+
grafana:
5+
hostname: grafana
6+
image: grafana:dev
7+
ports:
8+
- "3000:3000"
9+
- "2003:2003"
10+
volumes:
11+
- ./grafana.ini:/etc/grafana/grafana.ini
12+
renderer:
13+
hostname: renderer
14+
image: grafana-image-renderer:latest
15+
ports:
16+
- "8081:8081"
17+

0 commit comments

Comments
 (0)