From 4ef45f933eb09d99fbf100a62d3465143239ae98 Mon Sep 17 00:00:00 2001 From: yangjiewei <1658539101@qq.com> Date: Tue, 6 Aug 2024 10:06:12 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0Dockfile=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..304a7ac --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# 使用 Node.js 18 作为基础镜像 +FROM 10.4.117.234:8082/node:20-alpine + +# 在容器中创建工作目录 +WORKDIR /app + +# 拷贝整个应用程序到工作目录 +COPY . . + +# 安装依赖 +RUN yarn install --registry=http://10.4.117.234:8081/repository/npm-public/ + +# 构建应用程序 +RUN yarn build + +# 暴露端口 +EXPOSE 3100 + +# 运行应用程序 +CMD [ "npm", "run", "serve" ]