添加docker 部署agent
This commit is contained in:
@@ -1,20 +1,23 @@
|
||||
FROM node:18-alpine
|
||||
|
||||
WORKDIR /app
|
||||
# 切换阿里云 Alpine 镜像源(解决国内拉取 apk 包极慢的问题)
|
||||
RUN sed -i 's|https://dl-cdn.alpinelinux.org|https://mirrors.aliyun.com|g' /etc/apk/repositories
|
||||
|
||||
# 安装依赖
|
||||
COPY wxserver_daoqi/package.json ./
|
||||
RUN npm install --production
|
||||
|
||||
# 拷贝应用代码
|
||||
COPY wxserver_daoqi/ ./
|
||||
|
||||
# 设置时区
|
||||
# 设置时区(放在最前,避免后续步骤受 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"]
|
||||
|
||||
Reference in New Issue
Block a user