From d2a5ac6dea93e002cbc9999cdb8f9f82df52c56e Mon Sep 17 00:00:00 2001 From: fifsky Date: Mon, 16 Sep 2019 11:59:13 +0800 Subject: [PATCH] docker to hub --- Dockerfile | 35 +---------------------------------- docker/Dockerfile | 38 ++++++++++++++++++++++++++++++++++++++ package.json | 2 +- 3 files changed, 40 insertions(+), 35 deletions(-) create mode 100644 docker/Dockerfile diff --git a/Dockerfile b/Dockerfile index 3c07765..fcd6972 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,37 +1,4 @@ -FROM node:10-alpine +FROM fifsky/html-to-pdf LABEL MAINTAINER="Xudong Cai " -ENV TZ=Asia/Shanghai -ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true - -#chromium@76.0.3809.132-r0 -RUN apk update && apk upgrade && \ - echo @edge http://nl.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories && \ - echo @edge http://nl.alpinelinux.org/alpine/edge/main >> /etc/apk/repositories && \ - apk --no-cache add \ - tzdata \ - curl \ - ca-certificates \ - chromium@edge \ - nss@edge \ - fontconfig \ - freetype \ - ttf-dejavu \ - ttf-droid \ - ttf-freefont \ - mesa-egl \ - mesa-gles \ - && mkdir /usr/lib/chromium/swiftshader/ \ - && cp /usr/lib/libGLESv2.so.2 /usr/lib/chromium/swiftshader/libGLESv2.so \ - && cp /usr/lib/libEGL.so.1 /usr/lib/chromium/swiftshader/libEGL.so \ - && ln -sf /usr/bin/chromium-browser /usr/local/bin/chrome \ - && ln -sf /usr/share/zoneinfo/$TZ /etc/localtime \ - && echo $TZ > /etc/timezone \ - && mkdir -p /usr/share/fonts/chinese/TrueType/ -COPY simsun.ttf /usr/share/fonts/chinese/TrueType/simsun.ttf -RUN fc-cache -fv - -COPY . . - -RUN npm install --production ENTRYPOINT ["node", "/lib/main.js"] diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..88bdef6 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,38 @@ +FROM node:10-alpine +LABEL MAINTAINER="Xudong Cai " +ENV TZ=Asia/Shanghai +ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true + +#chromium@76.0.3809.132-r0 +RUN sed -i 's!http://dl-cdn.alpinelinux.org/!https://mirrors.aliyun.com/!g' /etc/apk/repositories \ + && apk update && apk upgrade && \ + echo @edge https://mirrors.aliyun.com/alpine/edge/community >> /etc/apk/repositories && \ + echo @edge https://mirrors.aliyun.com/alpine/edge/main >> /etc/apk/repositories && \ + apk --no-cache add \ + tzdata \ + curl \ + ca-certificates \ + chromium@edge \ + nss@edge \ + fontconfig \ + freetype \ + ttf-dejavu \ + ttf-droid \ + ttf-freefont \ + mesa-egl \ + mesa-gles \ + && mkdir /usr/lib/chromium/swiftshader/ \ + && cp /usr/lib/libGLESv2.so.2 /usr/lib/chromium/swiftshader/libGLESv2.so \ + && cp /usr/lib/libEGL.so.1 /usr/lib/chromium/swiftshader/libEGL.so \ + && ln -sf /usr/bin/chromium-browser /usr/local/bin/chrome \ + && ln -sf /usr/share/zoneinfo/$TZ /etc/localtime \ + && echo $TZ > /etc/timezone \ + && mkdir -p /usr/share/fonts/chinese/TrueType/ +COPY simsun.ttf /usr/share/fonts/chinese/TrueType/simsun.ttf +RUN fc-cache -fv + +COPY . . + +RUN npm install --production + +ENTRYPOINT ["node", "/lib/main.js"] diff --git a/package.json b/package.json index 223ab64..5d187a4 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "actions", "container", "toolkit", - "setup" + "pdf" ], "author": "fifsky@gmail.com", "license": "MIT",