Skip to content

Commit

Permalink
docker to hub
Browse files Browse the repository at this point in the history
  • Loading branch information
fifsky committed Sep 16, 2019
1 parent 76c52b4 commit d2a5ac6
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 35 deletions.
35 changes: 1 addition & 34 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,37 +1,4 @@
FROM node:10-alpine
FROM fifsky/html-to-pdf
LABEL MAINTAINER="Xudong Cai <[email protected]>"
ENV TZ=Asia/Shanghai
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true

#[email protected]
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"]
38 changes: 38 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
FROM node:10-alpine
LABEL MAINTAINER="Xudong Cai <[email protected]>"
ENV TZ=Asia/Shanghai
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true

#[email protected]
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"]
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"actions",
"container",
"toolkit",
"setup"
"pdf"
],
"author": "[email protected]",
"license": "MIT",
Expand Down

0 comments on commit d2a5ac6

Please sign in to comment.