完善docker配置

This commit is contained in:
小贺
2025-09-02 22:41:02 +08:00
parent 8de03156e1
commit 6b5603df84
10 changed files with 121 additions and 1 deletions

15
front/dockerfile Normal file
View File

@@ -0,0 +1,15 @@
# 构建阶段
FROM node:22 AS build
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
# 生产阶段
FROM nginx:alpine
COPY --from=build /app/dist /usr/share/nginx/html
# 复制nginx配置
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

View File

@@ -6,5 +6,5 @@ import App from './App.tsx'
createRoot(document.getElementById('root')!).render(
<StrictMode>
<App />
</StrictMode>,
</StrictMode>
)