FROM node:21-alpine as frontend-requirements RUN npm install -g pnpm WORKDIR /app COPY package*.json ./ RUN pnpm install FROM frontend-requirements as frontend-dev CMD ["pnpm", "run", "dev", "--host", "0.0.0.0"] FROM frontend-requirements as build ARG VITE_API_ENDPOINT ENV VITE_API_ENDPOINT=${VITE_API_ENDPOINT} WORKDIR /app COPY . ./ RUN pnpm run build FROM nginx:1.23 as final COPY --from=build /app/dist /app/dist ARG nginx_uid=33 ARG nginx_gid=33 RUN usermod -u ${nginx_uid} -o nginx && groupmod -g ${nginx_gid} -o nginx