This commit is contained in:
hailin 2025-07-17 20:47:20 +08:00
parent a6c04a18c8
commit dace1f9d85
1 changed files with 22 additions and 0 deletions

22
php_admin/Dockerfile Normal file
View File

@ -0,0 +1,22 @@
# 构建阶段
FROM node:20 AS builder
# 设置工作目录
WORKDIR /app
# 拷贝依赖文件并安装
COPY package*.json yarn.lock ./
RUN yarn install --frozen-lockfile
# 拷贝源代码
COPY . .
# 构建生产环境代码
RUN yarn build
# 导出阶段
FROM alpine:3.18 AS export
WORKDIR /export
# 仅导出编译产物
COPY --from=builder /app/dist ./dist