This commit is contained in:
2025-10-10 09:16:54 +08:00
parent 286e0851d0
commit cf62442906
10 changed files with 2309 additions and 2436 deletions

View File

@ -1,23 +1,16 @@
# 使用 Node.js 18 作为基础镜像
#FROM 10.4.117.234:8082/node:20-alpine
FROM --platform=linux/arm64 docker.xuanyuan.run/library/node:20-alpine
#FROM --platform=linux/arm64 docker.xuanyuan.run/library/node:20-alpine
FROM docker.tanuki.vip/nginx-amd64:1.29.0
MAINTAINER fucai
# 在容器中创建工作目录
WORKDIR /app
WORKDIR /usr/share/nginx/html
COPY ./nginx.conf /etc/nginx/nginx.conf # 拷贝 nginx 配置文件
COPY ./dist/ /usr/share/nginx/html/ # 拷贝 dist 目录下的文件到 nginx 的 html 目录下
# 拷贝整个应用程序到工作目录
COPY . .
EXPOSE 8080
# 安装依赖
RUN yarn install
VOLUME ["/etc/nginx/nginx.conf", "/usr/share/nginx/html"]
# 构建应用程序
RUN yarn build
CMD ["nginx","-g","daemon off;"]
# 暴露端口
EXPOSE 3100
# 运行应用程序
CMD [ "npm", "run", "serve" ]
#docker build -t pcitc/itc-web:1.0.0 .
# docker build -t itc-web:1.0.0 .