- Backend NestJS orchestrant CloudCompare CLI (stats, decimation x2 sur 5 etapes, volume, assemblage .bin) - Scripts Python (laspy, scipy, matplotlib) pour la conversion LAS/LAZ et la generation d'images - Frontend web simple (Tailwind CDN) avec historique des runs - Image Docker (debian:trixie-slim + cloudcompare apt + xvfb) prete pour deploiement Coolify - Lint/typecheck/tests unitaires integres comme portes de qualite au build Docker - CLAUDE.md documentant les comportements CloudCompare CLI verifies empiriquement
61 lines
1.9 KiB
Docker
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}/" || exit 1
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|