diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..97f672e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,68 @@ +FROM node:22-alpine AS builder + +WORKDIR /app + +# Installer pnpm +RUN npm install -g pnpm + +# Copier les fichiers de dépendances +COPY package.json pnpm-lock.yaml ./ +COPY patches/ ./patches/ + +# Installer toutes les dépendances (y compris devDependencies pour le build) +RUN pnpm install --frozen-lockfile + +# Copier les sources +COPY . . + +# Variables d'environnement pour le build Vite (frontend) +# Ces valeurs sont overridées par les ARG du docker-compose au moment du build +ARG VITE_APP_ID="" +ARG VITE_OAUTH_PORTAL_URL="" +ARG VITE_APP_TITLE="SONUM" +ARG VITE_APP_LOGO="" +ARG VITE_ANALYTICS_ENDPOINT="" +ARG VITE_ANALYTICS_WEBSITE_ID="" +ARG VITE_FRONTEND_FORGE_API_KEY="" +ARG VITE_FRONTEND_FORGE_API_URL="" + +ENV VITE_APP_ID=$VITE_APP_ID +ENV VITE_OAUTH_PORTAL_URL=$VITE_OAUTH_PORTAL_URL +ENV VITE_APP_TITLE=$VITE_APP_TITLE +ENV VITE_APP_LOGO=$VITE_APP_LOGO +ENV VITE_ANALYTICS_ENDPOINT=$VITE_ANALYTICS_ENDPOINT +ENV VITE_ANALYTICS_WEBSITE_ID=$VITE_ANALYTICS_WEBSITE_ID +ENV VITE_FRONTEND_FORGE_API_KEY=$VITE_FRONTEND_FORGE_API_KEY +ENV VITE_FRONTEND_FORGE_API_URL=$VITE_FRONTEND_FORGE_API_URL + +# Build : Vite (frontend → dist/public) + esbuild (serveur → dist/index.js) +RUN pnpm build + +# ── Stage production ────────────────────────────────────────────────────────── +FROM node:22-alpine AS production + +WORKDIR /app + +RUN npm install -g pnpm + +# Copier les fichiers nécessaires +COPY package.json pnpm-lock.yaml ./ +COPY patches/ ./patches/ + +# Installer toutes les dépendances (vite est requis au runtime par le serveur Express) +RUN pnpm install --frozen-lockfile + +# Copier les artefacts de build +COPY --from=builder /app/dist ./dist + +# Copier les fichiers de configuration et le seed +COPY drizzle.config.ts ./ +COPY drizzle/ ./drizzle/ +COPY seed-admin.mjs ./ +COPY shared/ ./shared/ +COPY server/ ./server/ + +EXPOSE 3000 + +# Démarrer le serveur et exécuter le seed admin +CMD node seed-admin.mjs && node dist/index.js diff --git a/client/public/logoFEHAP.PNG b/client/public/logoFEHAP.PNG new file mode 100644 index 0000000..bbf606c Binary files /dev/null and b/client/public/logoFEHAP.PNG differ diff --git a/client/src/const.ts b/client/src/const.ts index 9999063..335a171 100644 --- a/client/src/const.ts +++ b/client/src/const.ts @@ -4,6 +4,10 @@ export { COOKIE_NAME, ONE_YEAR_MS } from "@shared/const"; export const getLoginUrl = () => { const oauthPortalUrl = import.meta.env.VITE_OAUTH_PORTAL_URL; const appId = import.meta.env.VITE_APP_ID; + + // Si OAUTH_PORTAL_URL n'est pas configuré (déploiement sans OAuth Manus), retourner chaîne vide + if (!oauthPortalUrl) return ""; + const redirectUri = `${window.location.origin}/api/oauth/callback`; const state = btoa(redirectUri); diff --git a/client/src/pages/Login.tsx b/client/src/pages/Login.tsx index 8f657b4..db5dbac 100644 --- a/client/src/pages/Login.tsx +++ b/client/src/pages/Login.tsx @@ -2,11 +2,13 @@ import { getLoginUrl } from "@/const"; import { useLocation } from "wouter"; import { KeyRound, ExternalLink } from "lucide-react"; -const FEHAP_LOGO = "/manus-storage/logoFEHAP_69ddd0ee.PNG"; +const FEHAP_LOGO = "/logoFEHAP.PNG"; const SANTINOVA_LOGO_TEXT = "Santinova Soft"; export default function Login() { const [, navigate] = useLocation(); + const loginUrl = getLoginUrl(); + const oauthEnabled = !!loginUrl; return (
@@ -78,29 +80,33 @@ export default function Login() {

- {/* Connexion via espace adhérent FEHAP */} - -
- -
-
-
Espace adhérent FEHAP
-
- Connexion via votre compte FEHAP existant + {/* Connexion via espace adhérent FEHAP — masqué si OAuth non configuré */} + {oauthEnabled && ( + +
+
-
- - +
+
Espace adhérent FEHAP
+
+ Connexion via votre compte FEHAP existant +
+
+ + + )} - {/* Séparateur */} -
-
- ou -
-
+ {/* Séparateur — affiché seulement si OAuth activé */} + {oauthEnabled && ( +
+
+ ou +
+
+ )} {/* Connexion locale */}