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
|
WORKDIR /app
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm install
|
RUN npm install
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
FROM node:20-alpine
|
FROM nginx:alpine AS runtime
|
||||||
WORKDIR /app
|
COPY --from=build /app/dist /usr/share/nginx/html
|
||||||
COPY --from=builder /app/dist ./dist
|
|
||||||
RUN npm install -g serve
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
ENV NODE_ENV=production
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
CMD ["serve", "-s", "dist", "-l", "0.0.0.0:80"]
|
|
||||||
|
|||||||
Reference in New Issue
Block a user