Skip to content
This repository was archived by the owner on Aug 25, 2019. It is now read-only.

Commit 7b20300

Browse files
committed
use now v2 deployment features
1 parent 0fde12e commit 7b20300

12 files changed

+1076
-30
lines changed

Dockerfile

+27-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,29 @@
1-
FROM amio/node-chrome-cjk
1+
FROM alpine:edge as base
2+
RUN apk add --no-cache --update chromium tar zstd && \
3+
cd /usr/lib/chromium/locales/ && \
4+
find ./ -maxdepth 1 '!' -path './' '!' -path './en-US.pak' '!' -path './en-US.pak.info' -exec 'rm' '{}' ';' && \
5+
cd /usr/lib && \
6+
tar cvf /chromium_lib.tar ./chromium && \
7+
zstd --train -r /usr/lib/chromium -o /chromium_lib.dict && \
8+
zstd -f -22 --ultra -D /chromium_lib.dict /chromium_lib.tar
29

3-
WORKDIR /usr/src/app
4-
COPY . /usr/src/app
5-
RUN ls -al
6-
RUN npm install
10+
FROM mhart/alpine-node:10 as build
11+
WORKDIR /usr/src
12+
COPY package.json yarn.lock /usr/src/
13+
RUN PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 yarn install --production
14+
COPY src/ .
15+
COPY start.sh .
16+
RUN rm -rf **/README* **/.git*
717

8-
EXPOSE 3000
9-
CMD ["npm", "start"]
18+
FROM mhart/alpine-node:base-10
19+
WORKDIR /usr/src
20+
ENV NODE_ENV="production"
21+
COPY --from=base /chromium_lib.tar.zst /chromium_lib.dict /chrome/
22+
#RUN apk add --no-cache --update tar zstd && \
23+
RUN apk add --no-cache --update tar zstd alsa-lib at-spi2-atk atk cairo cups-libs dbus-libs eudev-libs expat flac fontconfig freetype gdk-pixbuf glib gtk+3.0 harfbuzz libatomic libevent libgcc libjpeg-turbo libpng libre2 libstdc++ libwebp libx11 libxcb libxcomposite libxcursor libxdamage libxext libxfixes libxi libxml2 libxrandr libxrender libxscrnsaver libxslt libxtst musl nspr nss opus pango snappy ttf-opensans minizip && \
24+
rm -rf /usr/share/gtk-doc
25+
ENV CHROME_BIN=/usr/bin/chromium-browser \
26+
CHROME_PATH=/usr/lib/chromium/
27+
COPY --from=build /usr/src/ .
28+
29+
CMD ["./start.sh"]

index.js

-10
This file was deleted.

now.json

+8-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
{
22
"name": "pageshot",
33
"type": "docker",
4+
"public": true,
45
"alias": [
56
"shot",
67
"pageshot"
7-
]
8+
],
9+
"features": {
10+
"cloud": "v2"
11+
},
12+
"limits": {
13+
"maxConcurrentReqs": 2
14+
}
815
}

0 commit comments

Comments
 (0)