Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +10 -5
Dockerfile
CHANGED
@@ -5,9 +5,17 @@ WORKDIR /app
|
|
5 |
# 克隆指定仓库代替COPY
|
6 |
RUN git clone https://github.com/qwertyuiopasdfghjklzxcvbnm0987654321/weibo-rss .
|
7 |
|
8 |
-
#
|
|
|
|
|
|
|
9 |
RUN npm i -g npm && npm install --package-lock-only
|
10 |
-
RUN npm ci --ignore-scripts
|
|
|
|
|
|
|
|
|
|
|
11 |
|
12 |
FROM node:18-alpine
|
13 |
LABEL maintainer="https://github.com/zgq354/weibo-rss"
|
@@ -19,12 +27,9 @@ RUN wget -O /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/
|
|
19 |
echo "057ecd4ac1d3c3be31f82fc0848bf77b1326a975b4f8423fe31607205a0fe945 /usr/local/bin/dumb-init" | sha256sum -c - && \
|
20 |
chmod 755 /usr/local/bin/dumb-init
|
21 |
|
22 |
-
# 从builder阶段复制依赖清单
|
23 |
COPY --from=builder /app/package.json /app/package-lock.json ./
|
24 |
-
# 安装生产依赖
|
25 |
RUN npm install --production
|
26 |
|
27 |
-
# 从builder阶段复制全部代码(包含构建结果)
|
28 |
COPY --from=builder /app ./
|
29 |
|
30 |
EXPOSE 3000
|
|
|
5 |
# 克隆指定仓库代替COPY
|
6 |
RUN git clone https://github.com/qwertyuiopasdfghjklzxcvbnm0987654321/weibo-rss .
|
7 |
|
8 |
+
# 修改TypeScript配置解决编译错误
|
9 |
+
RUN sed -i '/"compilerOptions"/a \ \ "skipLibCheck": true,' tsconfig.json
|
10 |
+
|
11 |
+
# 生成lock文件并安装依赖
|
12 |
RUN npm i -g npm && npm install --package-lock-only
|
13 |
+
RUN npm ci --ignore-scripts
|
14 |
+
|
15 |
+
# 临时修复node-network-devtools路径问题
|
16 |
+
RUN sed -i 's/___dirname/__dirname/g' node_modules/node-network-devtools/dist/src/core/fork.d.ts
|
17 |
+
|
18 |
+
RUN npm run build
|
19 |
|
20 |
FROM node:18-alpine
|
21 |
LABEL maintainer="https://github.com/zgq354/weibo-rss"
|
|
|
27 |
echo "057ecd4ac1d3c3be31f82fc0848bf77b1326a975b4f8423fe31607205a0fe945 /usr/local/bin/dumb-init" | sha256sum -c - && \
|
28 |
chmod 755 /usr/local/bin/dumb-init
|
29 |
|
|
|
30 |
COPY --from=builder /app/package.json /app/package-lock.json ./
|
|
|
31 |
RUN npm install --production
|
32 |
|
|
|
33 |
COPY --from=builder /app ./
|
34 |
|
35 |
EXPOSE 3000
|