iptv-app/web/Dockerfile
李岩岩 2cab50db31 feat(build): 配置多平台打包输出
- 添加 .env.web/.desktop/.android/.tv 环境变量文件
- 修改 vite.config.js 支持多平台输出到 dist/{platform}/
- 添加 npm run build:web/desktop/android/tv 命令
- 更新 desktop/android/android-tv/web 各端的资源引用路径
- 更新 build-mac.sh 使用 build:desktop 命令
2026-02-05 14:19:28 +08:00

33 lines
491 B
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 多阶段构建
# 阶段1构建前端
FROM node:18-alpine AS builder
WORKDIR /app
# 复制前端代码
COPY ../ui ./ui
WORKDIR /app/ui
RUN npm install && npm run build:web
# 阶段2运行服务端
FROM node:18-alpine
WORKDIR /app
# 安装依赖
COPY package*.json ./
RUN npm install --production
# 复制服务端代码
COPY src ./src
# 复制构建好的前端
COPY --from=builder /app/ui/dist/web ./public
# 暴露端口
EXPOSE 3000
# 启动
CMD ["node", "src/index.js"]