iptv-app/web/Dockerfile
李岩岩 52fc8099ae feat(web): 创建 Docker Web 服务端
- 添加 Express 服务端,提供频道 API
- 添加 M3U8/TS 流代理,解决跨域问题
- 添加 Dockerfile 和 docker-compose.yml
- 添加 Nginx 反向代理配置
- 支持多阶段构建,自动打包前端
2026-02-05 12:41:50 +08:00

33 lines
487 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
# 阶段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"]