-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.combine
38 lines (28 loc) · 1.54 KB
/
Dockerfile.combine
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
FROM node:16.13.2-buster-slim
# install chrome and tini
RUN apt-get update && apt-get install -y apt-transport-https ca-certificates && \
echo deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free > /etc/apt/sources.list && \
echo deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free >> /etc/apt/sources.list && \
echo deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free >> /etc/apt/sources.list && \
echo deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free >> /etc/apt/sources.list && \
apt-get update && apt-get install -y wget gnupg && \
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list && \
apt-get update && apt-get install -y google-chrome-stable && \
wget https://github.com/krallin/tini/releases/download/v0.19.0/tini -O /tini && chmod +x /tini
# install wkhtmltopdf
RUN apt-get update && apt-get install -y wkhtmltopdf
COPY ./app/package.json ./app/yarn.lock /app/
RUN cd /app && yarn install && rm -rf /root/.cache /root/.npm /usr/local/share/.cache/yarn/
# 安装中文字体
COPY ./fonts/ /usr/share/fonts
COPY ./app/ /app
WORKDIR /app
RUN yarn build
ENV NODE_ENV=production \
PORT=80 \
CONVERTOR=chrome \
GOOGLE_CHROME_BIN_PATH="/usr/bin/google-chrome" \
MAX_CONVERT_LIMIT=""
ENTRYPOINT ["/tini", "--"]
CMD ["yarn", "start"]