FROM node:latest AS node
USER node
WORKDIR /usr/src/app

COPY . .

RUN ["npm", "ci"]
RUN ["npx", "astro", "build"]

FROM joseluisq/static-web-server:2
WORKDIR /
COPY --from=node /usr/src/app/dist /public
ENV SERVER_REDIRECT_TRAILING_SLASH=false
