mirror of
https://github.com/wangwangit/qywx-push.git
synced 2026-05-06 20:43:05 +08:00
21 lines
455 B
Docker
21 lines
455 B
Docker
FROM node:18
|
|
|
|
WORKDIR /app
|
|
|
|
# 复制 package 文件
|
|
COPY package*.json ./
|
|
|
|
# 设置npm配置以提高稳定性
|
|
RUN npm config set registry https://registry.npmmirror.com \
|
|
&& npm config set fetch-retry-mintimeout 20000 \
|
|
&& npm config set fetch-retry-maxtimeout 120000
|
|
|
|
# 安装依赖 (使用--build-from-source确保sqlite3正确编译)
|
|
RUN npm install --build-from-source=sqlite3
|
|
|
|
# 复制应用代码
|
|
COPY . .
|
|
|
|
EXPOSE 3000
|
|
|
|
CMD ["npm", "start"] |