zhongrj
2025-02-17 427af97793c24bf6c6630a54e2b8af56f1bb586e
修改
2 files modified
15 ■■■■ changed files
Dockerfile 12 ●●●●● patch | view | raw | blame | history
docker-compose.yml 3 ●●●● patch | view | raw | blame | history
Dockerfile
@@ -14,4 +14,14 @@
RUN npm run build-only
# 查看
RUN ls /app/dist
RUN ls /app/dist
# 创建一个新的镜像阶段,用于最终镜像的构建
FROM alpine:latest AS final-image
# 创建一个目录来存放打包后的文件
RUN mkdir -p /app/dist-final
# 将构建阶段中的打包文件拷贝到最终镜像的指定目录
# 注意:这里使用了 `--from=build-env` 来引用前面的构建阶段
COPY --from=build-env /app/dist /app/dist-final
docker-compose.yml
@@ -6,5 +6,4 @@
    ports:
      - "8310:80"
    volumes:
      - /software/service/drone/web/pilot-h5:/app/dist
    restart: always
      - /software/service/drone/web/pilot-h5:/app/dist-final