highcharts / highcharts/node-export-server
Fetch Highcharts from CDN during docker build
- Lingua principale
- JavaScript
- Stelle
- 369
- Fork
- 266
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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?
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Direzione di ricerca
Inizia dal passaggio npm install del Dockerfile e dal punto di ingresso node_modules/highcharts-export-server/bin/cli.js. Traccia quando gli script del CDN vengono scaricati durante l’avvio, quindi determina come la build possa recuperarli e conservarli affinché un container si avvii senza accesso alla rete. Il lavoro è completato quando l’immagine viene compilata in modo riproducibile e il server di esportazione si avvia senza scaricare script.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- docker, dockerfile, javascript, node.js
- Ambito
- devops, infrastructure
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100