Use nginx (official Astro recommendation)
This commit is contained in:
11
Dockerfile
11
Dockerfile
@@ -1,14 +1,11 @@
|
||||
FROM node:20-alpine AS builder
|
||||
FROM node:20-alpine AS build
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
FROM node:20-alpine
|
||||
WORKDIR /app
|
||||
COPY --from=builder /app/dist ./dist
|
||||
RUN npm install -g serve
|
||||
FROM nginx:alpine AS runtime
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
EXPOSE 80
|
||||
ENV NODE_ENV=production
|
||||
CMD ["serve", "-s", "dist", "-l", "0.0.0.0:80"]
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
|
||||
Reference in New Issue
Block a user