commit 77a33bdbc335a8020960c4fad311f0f37f2889a1 Author: stanig2106 Date: Wed Sep 10 00:09:27 2025 +0200 AAT docker diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d8a6b63 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,19 @@ +# Image Node 22 +FROM node:22-alpine + +# Outils utiles pour certaines dépendances natives et git +RUN apk add --no-cache \ + git \ + python3 \ + make \ + g++ \ + bash \ + libc6-compat + +# Dossier persistant où l'install déposera l'app +WORKDIR /data + +# Port utilisé par l'UI d'installation et par l'app +EXPOSE 8080 + +# Pas d'ENTRYPOINT: on pilote via 'command' dans docker-compose diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..19278b3 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,77 @@ +version: "3.9" + +services: + mongo: + image: mongo:6.0 + restart: unless-stopped + volumes: + - mongo-data:/data/db + + # Phase d'installation - UI sur 8080 pour config initiale + adapt-install: + build: . + profiles: ["install"] + depends_on: + - mongo + environment: + - NODE_ENV=production + ports: + - "3500:8080" + volumes: + - app-data:/data + command: > + sh -lc "rm -rf /data/app; npx adapt-security/at-utils install --prerelease /data/app" + restart: "no" + + # Phase de run - lance l'app déjà installée + adapt: + build: . + profiles: ["run"] + depends_on: + - mongo + environment: + - NODE_ENV=production + ports: + - "3500:8080" + volumes: + - app-data:/data + working_dir: /data/app + command: > + sh -lc "npm start" + restart: unless-stopped + + # Phase de mise à jour + adapt-update: + build: . + profiles: ["update"] + depends_on: + - mongo + environment: + - NODE_ENV=production + ports: + - "3500:8080" + volumes: + - app-data:/data + working_dir: /data/app + command: > + sh -lc "npx adapt-security/at-utils update --prerelease ." + restart: "no" + + # Initialisation super user + adapt-init-super: + build: . + profiles: ["init-super"] + depends_on: + - mongo + environment: + - NODE_ENV=production + volumes: + - app-data:/data + working_dir: /data/app + command: > + sh -lc "echo 'poplpopl' | npx adapt-security/at-utils register-super --super-email stani@eduvia.app --pipe-passwd --ignore-prereqs --verbose" + restart: "no" + +volumes: + mongo-data: + app-data: