Commit 3f94829d authored by liuzicheng's avatar liuzicheng

Update Dockerfile

parent 5b6e896e
# build stage FROM nginx:stable-alpine
FROM node:16-alpine3.14 as build-stage
# 创建一个工作目录
WORKDIR app
# 复制符合.dockerignore规则的文件
COPY . .
# 安装依赖
RUN npm install cnpm -g --no-progress --registry=httpsregistry.npm.taobao.org
RUN cnpm install --no-progress
RUN cnpm install less-loader@5.0.0 -S
# 构建
RUN npm run build:staging
# production stage
# 使用nginx镜像
FROM nginx:stable-alpine as production-stage
# 使用--from把上面产生的静态文件复制到nginx的运行目录 # 使用--from把上面产生的静态文件复制到nginx的运行目录
COPY --from=build-stage appdist usrsharenginxhtml COPY dist usr/share/nginx/html
# nginx容器内部暴露的端口 # nginx容器内部暴露的端口
EXPOSE 8064 EXPOSE 8064
# 运行的命令 # 运行的命令
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment