Files
teapot_system/frontend/Dockerfile

18 lines
477 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 AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
# NAS部署非常关键的一步由于走Nginx同域反代需将URL置空以使用相对路径避免局域网IP锁死
ENV VITE_API_BASE_URL=""
RUN npm run build
FROM nginx:alpine
# 获取vite构件结果
COPY --from=builder /app/dist /usr/share/nginx/html
# 覆盖Nginx默认配置
COPY nginx.conf /etc/nginx/conf.d/default.conf
# 暴露的Web服务器访问端口
EXPOSE 80