Le depot ne contient plus qu'une seule application : plus de paquets
@cohaise/ui ni @cohaise/server.
- backend/shared/src -> backend/cloud/src/lib (socle serveur inline)
- frontend/shared/src -> frontend/cloud/src/{ui,styles,fonts}
- imports @cohaise/server / @cohaise/ui remplaces par des chemins relatifs
- package.json, tsconfig, Dockerfiles et docker-compose sans workspace partage
- docs (README, architecture, standards, workflow, agents, api, security,
deployment, docker) alignes sur la structure autonome
36 lines
898 B
Docker
36 lines
898 B
Docker
# Image des services API Node du Cloud. APP_DIR choisit le paquet a construire
|
|
# (API ou CLI de migration) ; les deux partagent la meme methode de build.
|
|
FROM node:22-alpine AS builder
|
|
|
|
ARG APP_DIR
|
|
|
|
WORKDIR /repo
|
|
|
|
COPY package.json package-lock.json tsconfig.json tsconfig.base.json ./
|
|
COPY backend ./backend
|
|
|
|
RUN --mount=type=cache,target=/root/.npm npm ci
|
|
RUN npm run build --workspace=${APP_DIR}
|
|
|
|
# On ne embarque pas les devDependencies dans l'image de production.
|
|
RUN npm prune --omit=dev && npm cache clean --force
|
|
|
|
FROM node:22-alpine AS export
|
|
|
|
ARG APP_DIR
|
|
|
|
ENV NODE_ENV=production
|
|
|
|
WORKDIR /repo
|
|
|
|
COPY --from=builder /repo/package.json ./package.json
|
|
COPY --from=builder /repo/package-lock.json ./package-lock.json
|
|
COPY --from=builder /repo/node_modules ./node_modules
|
|
COPY --from=builder /repo/${APP_DIR} ./${APP_DIR}
|
|
|
|
WORKDIR /repo/${APP_DIR}
|
|
|
|
EXPOSE 8080
|
|
|
|
CMD ["node", "dist/index.js"]
|