-
Notifications
You must be signed in to change notification settings - Fork 14
/
Dockerfile
executable file
·65 lines (51 loc) · 1.88 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
FROM node:10-slim
LABEL maintainer="[email protected]"
# Update
RUN apt-get update --fix-missing \
&& apt-get upgrade -y \
&& apt-get install -y wget gnupg libxss1 \
&& apt-get clean
# Locale settings (japanese)
RUN apt-get install -y locales task-japanese \
&& locale-gen ja_JP.UTF-8 \
&& localedef -f UTF-8 -i ja_JP ja_JP
ENV LANG ja_JP.UTF-8
ENV LANGUAGE ja_JP:jp
ENV LC_ALL ja_JP.UTF-8
# Install stable chrome and dependencies.
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
&& apt-get update \
&& apt-get install -y google-chrome-stable --no-install-recommends \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /src/*.deb
# It's a good idea to use dumb-init to help prevent zombie chrome processes.
ADD https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64 /usr/local/bin/dumb-init
RUN chmod +x /usr/local/bin/dumb-init
# if use default chromium installed with puppeteer
ENV HCEP_USE_CHROMIUM true
# else use chrome enable below settings
#ENV HCEP_USE_CHROMIUM false
#ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
#ENV CHROME_BINARY /usr/bin/google-chrome
# If you want to extend pdf options, rename app/my-pdf-option-presets.js.sample to app/my-pdf-option-presets.js and activate this
ENV HCEP_MY_PDF_OPTION_PRESETS_FILE_PATH="./my-pdf-option-presets"
ENV NODE_ENV production
RUN mkdir /hcep/
COPY package.json /hcep/
WORKDIR /hcep/
RUN npm install -u npm && \
npm install -g mocha eslint && \
npm install
# Install fonts
COPY fonts /usr/share/fonts
COPY app /hcep/app
RUN chmod -R 777 /hcep/app
# Test
COPY test /hcep/test
RUN mocha
# RUN rm -rf /hcep/test && npm uninstall -g mocha eslint
EXPOSE 8000
ENTRYPOINT ["dumb-init", "--"]
CMD ["npm", "start"]