# 基于 Debian 最新版本 FROM debian:stable-slim # 安装必要的工具和依赖 RUN apt-get update && apt-get install -y \ curl \ git \ build-essential \ libssl-dev \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # 安装 Node.js 和 npm RUN curl -sL https://deb.nodesource.com/setup_18.x | bash - \ && apt-get install -y nodejs # 创建工作目录 WORKDIR /app # 复制项目文件到容器中 COPY . /app # 安装 Vue 项目依赖 RUN npm install # 构建 Vue 项目 RUN npm run build # 暴露默认的 Vue 项目端口 EXPOSE 8080 # 启动 Vue 应用 CMD ["npm", "run", "serve"]