- redesigned /login (Tailwind, RTL): centered username/password/organization form posting to POST /api/v1/auth/login — session starts without leaving the page; PM lands on the inventory panel, others on the procurement office - Developer Mode button fixed top-left opens a role/project test panel (admin role added) gated by VITE_ENABLE_DEV_LOGIN (DEV_LOGIN_ENABLED build arg in Docker, default enabled) - removed the old Casdoor redirect button, the PKCE ?code= callback, and the public casdoor-config.js — the client secret is no longer shipped to the browser; backend mediates the password grant instead
34 lines
952 B
Docker
34 lines
952 B
Docker
# Frontend image — multi-stage build
|
|
# Stage 1: build the Vite app with Node.js
|
|
# Stage 2: serve static files with nginx (which also proxies /api -> api:8000)
|
|
|
|
FROM node:22-alpine AS build
|
|
|
|
WORKDIR /app
|
|
|
|
# Dependencies first (layer caching)
|
|
# NPM_REGISTRY overridable; default points at npmmirror because
|
|
# registry.npmjs.org is unreachable from this network.
|
|
ARG NPM_REGISTRY=https://registry.npmmirror.com
|
|
COPY package.json package-lock.json ./
|
|
RUN npm config set registry ${NPM_REGISTRY} && npm ci
|
|
|
|
# Developer Mode panel on the login page (default enabled; set to
|
|
# "false" to build a production login without the dev panel).
|
|
ARG DEV_LOGIN_ENABLED=true
|
|
ENV VITE_ENABLE_DEV_LOGIN=${DEV_LOGIN_ENABLED}
|
|
|
|
# Source code + build
|
|
COPY . .
|
|
RUN npm run build
|
|
|
|
# ---------- runtime ----------
|
|
FROM nginx:alpine
|
|
|
|
COPY --from=build /app/dist /usr/share/nginx/html
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
EXPOSE 80
|
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|