script-volume-auto/Dockerfile
Nicolas Fryder 7f2e4c323b Auth HTTP Basic + grille de volume adaptative par niveau
- Grille de calcul du volume adaptee dynamiquement au pas spatial de chaque niveau (au lieu d'une
  grille fixe derivee du niveau 0) : evite l'effondrement artificiel du "matching cells %" observe
  des le premier niveau de decimation (99% -> 58% -> 13% -> 3% -> 0.9% -> 0.2%), qui refletait un
  desalignement grille/densite plutot qu'une vraie perte d'information.
- Authentification HTTP Basic sur toute l'app (UI + API), identifiants en env (AUTH_USERNAME /
  AUTH_PASSWORD_HASH hashe bcrypt), desactivable en dev local si non definis. /health reste public
  pour le healthcheck Docker/Coolify.
2026-07-10 14:34:27 +02:00

61 lines
1.9 KiB
Docker

# syntax=docker/dockerfile:1
# ---------- Etape 1 : build du backend NestJS ----------
FROM node:20-bookworm AS backend-build
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm install
COPY tsconfig.json tsconfig.build.json nest-cli.json eslint.config.mjs ./
COPY src ./src
# Portes de qualite : le build Docker (donc le deploiement Coolify) echoue si l'une de ces
# etapes echoue. Voir CLAUDE.md pour le detail des scripts.
RUN npm run lint
RUN npm run typecheck
RUN npm run test
RUN npm run build
RUN npm prune --omit=dev
# ---------- Etape 2 : image finale ----------
# Debian trixie fournit CloudCompare 2.13.2 directement en apt (paquet "cloudcompare"),
# ce qui evite une compilation depuis les sources (tres longue et fragile).
FROM debian:trixie-slim
ENV DEBIAN_FRONTEND=noninteractive \
NODE_ENV=production \
DATA_DIR=/data \
CLOUDCOMPARE_BIN=CloudCompare \
PYTHON_BIN=python3 \
DISPLAY=:99
RUN apt-get update && apt-get install -y --no-install-recommends \
cloudcompare \
xvfb \
x11-utils \
ca-certificates \
curl \
gnupg \
python3 \
python3-pip \
&& curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \
&& apt-get install -y --no-install-recommends nodejs \
&& rm -rf /var/lib/apt/lists/*
COPY python/requirements.txt /app/python/requirements.txt
RUN pip3 install --break-system-packages --no-cache-dir -r /app/python/requirements.txt
WORKDIR /app
COPY --from=backend-build /app/node_modules ./node_modules
COPY --from=backend-build /app/dist ./dist
COPY package.json ./
COPY python ./python
COPY public ./public
COPY docker/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh && mkdir -p /data
VOLUME ["/data"]
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
CMD curl -fsS "http://localhost:${PORT:-3000}/health" || exit 1
ENTRYPOINT ["/entrypoint.sh"]