diff --git a/Dockerfile b/Dockerfile index d4db1bc..a7a550f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,24 +1,15 @@ -# 使用官方Node.js镜像 -FROM node:18-alpine +# 使用阿里云镜像 +FROM registry.cn-hangzhou.aliyuncs.com/library/node:18-alpine LABEL maintainer="hejiayu " WORKDIR /gitlink_help_center # 设置 npm 和 yarn 使用淘宝镜像 -RUN npm config set registry https://registry.npmmirror.com && \ - yarn config set registry https://registry.npmmirror.com +RUN npm config set registry https://registry.npmmirror.com +RUN yarn config set registry https://registry.npmmirror.com -# 创建必要的目录 -RUN mkdir -p docs versioned_docs/version-1.1.0 - -# 复制所有文件 -COPY . . - -# 安装依赖并构建 -RUN yarn install && \ - yarn build --locale zh-cn - -# 暴露端口 -EXPOSE 3000 +COPY ./ /gitlink_help_center/ +RUN yarn install +RUN npm run build -- --locale zh-cn CMD ["npm", "run", "serve"] \ No newline at end of file