Files
teapot_system/frontend/Dockerfile
2026-04-12 19:04:31 +08:00

13 lines
409 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.
FROM node:18-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
# NAS部署使用相对路径以便让Vite Preview接管同域/api路由并代理给backend容器
ENV VITE_API_BASE_URL=""
RUN npm run build
# 安装一个轻量静态服务器 (http-server 或 serve),或者直接使用 vite preview
EXPOSE 8090
CMD ["npm", "run", "preview", "--", "--host", "0.0.0.0", "--port", "8090"]