Files
electron-rare.github.io/Dockerfile
T
L'électron rare 7787bed2e9 refactor: contact form delegates to mail-api
Replace nodemailer SMTP with HTTP fetch to mail-api
container (http://mail-api:3200/api/mail/send) which
already holds the Brevo SMTP creds. Single source of
truth for mail credentials, no duplication across
electron-rare-site and mail-api.

Drop nodemailer + @types/nodemailer from deps. Restore
npm ci in Dockerfile since the lock no longer drifts.

Override defaults via env: MAIL_API_URL, MAIL_FROM,
MAIL_TO. mail-api intra-Docker network reachable
because both services are on the traefik network.
2026-04-28 10:02:07 +02:00

25 lines
734 B
Docker

FROM node:22-alpine AS base
WORKDIR /app
FROM base AS deps
COPY package.json package-lock.json ./
COPY apps/lab-interactif/package.json apps/lab-interactif/package-lock.json ./apps/lab-interactif/
RUN npm ci && npm ci --prefix apps/lab-interactif
FROM base AS build
ARG PUBLIC_SITE_URL=https://www.lelectronrare.fr
ENV PUBLIC_SITE_URL=${PUBLIC_SITE_URL}
COPY --from=deps /app/node_modules ./node_modules
COPY --from=deps /app/apps/lab-interactif/node_modules ./apps/lab-interactif/node_modules
COPY . .
RUN npm run build
FROM node:22-alpine AS runtime
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY --from=build /app/dist ./dist
ENV HOST=0.0.0.0
ENV PORT=4321
EXPOSE 4321
CMD ["node", "dist/server/entry.mjs"]