15 lines
412 B
Docker
15 lines
412 B
Docker
# Build the static Astro site
|
|
FROM node:22-alpine AS build
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json ./
|
|
RUN npm ci
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
# Serve static files with a small, unprivileged web server
|
|
FROM nginxinc/nginx-unprivileged:1.27-alpine AS production
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
COPY --from=build /app/dist /usr/share/nginx/html
|
|
EXPOSE 8080
|
|
CMD ["nginx", "-g", "daemon off;"]
|