-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
43 lines (29 loc) · 1.06 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
FROM node:10-alpine
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
ENV CHROME_BIN=/usr/bin/chromium-browser
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 add --no-cache chromium@edge nss@edge
RUN apk add --no-cache bash grep coreutils jq ca-certificates dumb-init libstdc++
WORKDIR /app
# Set language to UTF8
ENV LANG="C.UTF-8"
COPY package*.json ./
COPY .babelrc ./
COPY src ./src
COPY config ./config
RUN npm ci && npm run build
COPY src/views lib/views
RUN rm .babelrc src -rf && npm prune --production
# Add user so we don't need --no-sandbox.
RUN addgroup -S pptruser && adduser -S -g pptruser pptruser \
&& mkdir -p /home/pptruser/Downloads \
&& chown -R pptruser:pptruser /home/pptruser \
&& chown -R pptruser:pptruser /app
# Run everything after as non-privileged user.
USER pptruser
ENV NODE_ENV production
EXPOSE 3005
ENTRYPOINT ["dumb-init", "--"]
CMD ["node", "lib/start.js"]