# syntax=docker/dockerfile:1.7 # thothii-frontend: build Vite (React) + nginx-unprivileged (porta 8080). FROM node:22-bookworm AS build WORKDIR /src COPY frontend/package*.json ./ RUN npm ci COPY frontend/ ./ ENV VITE_BASE=/ VITE_BACKEND_URL=/api RUN npm run build FROM nginxinc/nginx-unprivileged:1.27-alpine AS runtime COPY --from=build /src/dist /usr/share/nginx/html COPY docker/nginx.conf.template /etc/nginx/templates/default.conf.template COPY --chmod=755 docker/frontend-entrypoint.sh /usr/local/bin/frontend-entrypoint ENTRYPOINT ["/usr/local/bin/frontend-entrypoint"] CMD ["nginx", "-g", "daemon off;"] EXPOSE 8080