24 lines
690 B
Docker
24 lines
690 B
Docker
FROM node:18-alpine
|
|
|
|
# 切换阿里云 Alpine 镜像源(解决国内拉取 apk 包极慢的问题)
|
|
RUN sed -i 's|https://dl-cdn.alpinelinux.org|https://mirrors.aliyun.com|g' /etc/apk/repositories
|
|
|
|
# 设置时区(放在最前,避免后续步骤受 apk 慢影响)
|
|
RUN apk add --no-cache tzdata \
|
|
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
|
&& echo "Asia/Shanghai" > /etc/timezone \
|
|
&& apk del tzdata
|
|
|
|
WORKDIR /app
|
|
|
|
# 安装依赖(使用淘宝 npm 镜像加速)
|
|
COPY wxserver_daoqi/package.json ./
|
|
RUN npm install --production --registry=https://registry.npmmirror.com
|
|
|
|
# 拷贝应用代码
|
|
COPY wxserver_daoqi/ ./
|
|
|
|
EXPOSE 3000
|
|
|
|
CMD ["node", "index.js"]
|