File size: 1,709 Bytes
181e22f
 
 
 
49d0907
 
 
 
 
 
181e22f
 
 
 
49d0907
 
181e22f
 
 
 
 
 
58ff041
 
 
 
 
 
181e22f
 
58ff041
0a5d824
 
 
 
 
58ff041
181e22f
 
 
 
 
 
 
 
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
FROM node:16

WORKDIR /tmp

RUN echo "deb [check-valid-until=no] http://archive.debian.org/debian buster main contrib non-free" > /etc/apt/sources.list && \
    echo "deb [check-valid-until=no] http://archive.debian.org/debian buster-updates main contrib non-free" >> /etc/apt/sources.list && \
    echo "deb [check-valid-until=no] http://archive.debian.org/debian-security buster/updates main contrib non-free" >> /etc/apt/sources.list && \
    apt-get -o Acquire::Check-Valid-Until=false update && \
    apt-get install -y --no-install-recommends apt-utils && \
    apt-get install -y \
      wget gnupg fonts-noto-cjk libxss1 \
      fonts-liberation libasound2 libatk-bridge2.0-0 libatspi2.0-0 libdrm2 \
      libgbm1 libgtk-3-0 libnspr4 libnss3 libx11-xcb1 libxkbcommon0 xdg-utils  \
      libu2f-udev libvulkan1 \
      --no-install-recommends && \
    rm -rf /var/lib/apt/lists/*

RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
RUN apt-get install ./google-chrome-stable_current_amd64.deb

WORKDIR /app

# 原步骤:
# COPY server/package.json ./
# COPY server/yarn.lock ./
# RUN yarn

# 修改后:
COPY server/package.json ./
COPY server/yarn.lock ./
# 切换到新的npmmirror镜像源(解决证书过期问题)
# 关键步骤:替换yarn.lock中硬编码的旧镜像源地址
RUN sed -i 's#https://registry.npm.taobao.org#https://registry.npmmirror.com#g' yarn.lock && \
    # 确认全局registry配置
    yarn config set registry https://registry.npmmirror.com && \
    # 安装依赖
    yarn

RUN yarn

COPY ./server ./
COPY ./client/build/*.js ./public/static/js/
COPY ./client/build/*.css ./public/static/css/

ENTRYPOINT ["node", "src/index.js"]