update
This commit is contained in:
14
Dockerfile
14
Dockerfile
@ -23,9 +23,15 @@ RUN npm ci
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# ---- 静态托管阶段 ----
|
||||
FROM nginx:alpine
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
# ---- 运行阶段 ----
|
||||
# 前端以 @astrojs/node standalone server 运行(监听 3000),nginx 反代 / 到该端口、
|
||||
# 反代 /api 到 backend:8090。这样 on-demand SSR 详情页 / sitemap / robots 才能正确产出 HTML。
|
||||
FROM node:22-alpine
|
||||
RUN apk add --no-cache nginx
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/dist ./dist
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
RUN chmod +x /entrypoint.sh
|
||||
EXPOSE 80
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
Reference in New Issue
Block a user