highcharts / highcharts/node-export-server

Fetch Highcharts from CDN during docker build

Open
#415 15 comments 0 reactions 0 assignees View on GitHub
enhancement puppeteer
Dominant language
JavaScript
Stars
369
Forks
266
PR merge metrics
No merged PRs in 30d

Description

I'm currently experimenting with the `enhancement/puppeteer` branch, trying to move from a Windows installation to running the export server inside a container.

I've started with something basic, based on other issues that have been reported

```Dockerfile
FROM node:alpine

WORKDIR /home/highchart-export-server

ENV ACCEPT_HIGHCHARTS_LICENSE=1
ENV HIGHCHARTS_VERSION=11.1.0
ENV HIGHCHARTS_USE_MAPS=0
ENV HIGHCHARTS_USE_GANTT=0
ENV HIGHCHARTS_CDN=npm

RUN apk update \
&& apk upgrade \
&& apk add --no-cache git patch \
&& rm -rf /var/lib/apt/lists/*

RUN npm install highcharts-export-server@3.0.0-beta.1

EXPOSE 7801

ENTRYPOINT ["node", "node_modules/highcharts-export-server/bin/cli.js", "--enableServer", "1", "--port", "7801", "--logLevel", "3"]
```

The issue I have is that running the export server on container startup initiates the script download from the CDN. To avoid this in production, and ensure we have exactly the same container running in each instance, what's the best approach to get this information downloaed and baked into the container image?

I've tried runing the `cli.js` directly in the `docker build` command to no avail..

Is it possible to pre-fetch the scripts etc during the build phase, or is it limited to startup of the server itself?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.