1.0.1 初始化铜壶管理系统项目并配置容器化
This commit is contained in:
18
frontend/Dockerfile
Normal file
18
frontend/Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
||||
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
|
||||
Reference in New Issue
Block a user