+8
-6
@@ -1,4 +1,4 @@
|
||||
# Build: generates /dist (Astro static site + Sanity Studio SPA)
|
||||
# Build: generates /dist (Astro SSR build + Sanity Studio SPA)
|
||||
FROM node:22-alpine AS builder
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
@@ -6,9 +6,11 @@ RUN npm ci
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# Frontend: Nginx serving the static site + Sanity Studio SPA
|
||||
FROM nginx:alpine AS frontend
|
||||
RUN rm /etc/nginx/conf.d/default.conf
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||
# Server: Node.js running the Astro SSR server
|
||||
FROM node:22-alpine
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app/node_modules ./node_modules
|
||||
COPY --from=builder /app/dist ./dist
|
||||
ENV PORT=80
|
||||
EXPOSE 80
|
||||
CMD ["node", "./dist/server/entry.mjs"]
|
||||
Reference in New Issue
Block a user