feat: 按历史痕迹恢复 nginx 同域入口

This commit is contained in:
Cheng Zhou
2026-03-31 09:16:41 +08:00
parent ada3beca8e
commit 9535fece6c
8 changed files with 122 additions and 30 deletions
-5
View File
@@ -1,5 +0,0 @@
:4173
root * /srv
try_files {path} /index.html
file_server
+3 -7
View File
@@ -2,18 +2,14 @@ FROM node:20-alpine AS build
WORKDIR /app
ARG VITE_API_BASE_URL
ENV VITE_API_BASE_URL=${VITE_API_BASE_URL}
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM caddy:2-alpine
FROM alpine:3.21
COPY Caddyfile /etc/caddy/Caddyfile
COPY --from=build /app/dist /srv
WORKDIR /opt/frontend
EXPOSE 4173
COPY --from=build /app/dist ./dist