From 0e8c27e200d09b5ecf71eb5d434386611549d3fe Mon Sep 17 00:00:00 2001 From: Quentin Roussel Date: Wed, 12 Apr 2023 00:54:25 +0200 Subject: [PATCH] =?UTF-8?q?modification=20du=20container=20interface=20adm?= =?UTF-8?q?in=20replac=C3=A9=20apache=20par=20next=20start?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- code/analyseur_texte/Dockerfile | 5 +--- code/backend_reconnaissance/Dockerfile | 15 ++++++++--- code/docker-compose.yaml | 15 ++++++----- code/interface_admin/Dockerfile | 37 ++++++++++++++++++++++++++ code/interface_admin/package.json | 1 - docs/TODO_PAN4.md | 2 +- 6 files changed, 59 insertions(+), 16 deletions(-) create mode 100644 code/interface_admin/Dockerfile diff --git a/code/analyseur_texte/Dockerfile b/code/analyseur_texte/Dockerfile index 16b1ca7..a60b534 100644 --- a/code/analyseur_texte/Dockerfile +++ b/code/analyseur_texte/Dockerfile @@ -1,13 +1,10 @@ -FROM python:3.8 +FROM python:3.8-alpine #Ne pas créer les fichiers .pyc ENV PYTHONDONTWRITEBYTECODE=1 #Afficher les logs directement dans le terminal ENV PYTHONUNBUFFERED=1 -#Installation des dépendances de opencv -RUN apt-get update - # Installation des dépendances python COPY requirements.txt . RUN python -m pip install -r requirements.txt diff --git a/code/backend_reconnaissance/Dockerfile b/code/backend_reconnaissance/Dockerfile index 1a75d72..8e78e64 100644 --- a/code/backend_reconnaissance/Dockerfile +++ b/code/backend_reconnaissance/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.8 +FROM python:3.8-slim #Ne pas créer les fichiers .pyc ENV PYTHONDONTWRITEBYTECODE=1 @@ -6,14 +6,21 @@ ENV PYTHONDONTWRITEBYTECODE=1 ENV PYTHONUNBUFFERED=1 #Installation des dépendances de opencv -RUN apt-get update -RUN apt-get install ffmpeg libsm6 libxext6 portaudio19-dev python3-pyaudio pulseaudio -y +RUN apt-get update && apt-get install -y \ + ffmpeg \ + libsm6 \ + libxext6 \ + portaudio19-dev \ + python3-pyaudio \ + gcc \ + && rm -rf /var/lib/apt/lists/* + # Installation des dépendances python COPY requirements.txt . RUN python -m pip install -r requirements.txt # Création du répertoire de travail WORKDIR /app -COPY . /app +COPY . . CMD ["python", "main.py"] diff --git a/code/docker-compose.yaml b/code/docker-compose.yaml index 8c824f1..c4be483 100644 --- a/code/docker-compose.yaml +++ b/code/docker-compose.yaml @@ -71,12 +71,15 @@ services: #Serveur web de l'interface admin interface_admin: - image: httpd:latest - volumes: - - ./interface_admin/out:/usr/local/apache2/htdocs/ - container_name: interface_admin + build: ./interface_admin ports: - - 800:80 + - 800:3000 + # image: httpd:latest + # volumes: + # - ./interface_admin/out:/usr/local/apache2/htdocs/ + # container_name: interface_admin + # ports: + # - 800:80 #Formulaire de retour d'avis formulaire: @@ -113,10 +116,10 @@ services: # - HOST=backend_reconnaissance # - API_HOST=reviews_api # - API_PORT=8080 + # - CAMERA_ID=0 # ports: # #Ce container est le serveur websocker dont le client est l'interface de la borne qui tourne dans le navigateur # - 5000:5000 - # user: root video_loopback: build: ./video_loopback diff --git a/code/interface_admin/Dockerfile b/code/interface_admin/Dockerfile new file mode 100644 index 0000000..d11b0de --- /dev/null +++ b/code/interface_admin/Dockerfile @@ -0,0 +1,37 @@ +FROM node:18-alpine AS deps +RUN apk add --no-cache libc6-compat +WORKDIR /app + +COPY package.json package-lock.json ./ +RUN npm install --production + +FROM node:18-alpine AS builder +WORKDIR /app +COPY --from=deps /app/node_modules ./node_modules +COPY . . + +ENV NEXT_TELEMETRY_DISABLED 1 + +RUN npm run build + +FROM node:18-alpine AS runner +WORKDIR /app + +ENV NODE_ENV production +ENV NEXT_TELEMETRY_DISABLED 1 + +RUN addgroup --system --gid 1001 nodejs +RUN adduser --system --uid 1001 nextjs + +#TODO : changer pour prod +# COPY --from=builder --chown=nextjs:nodejs /app/.next ./.next +# COPY --from=builder /app/node_modules ./node_modules +# COPY --from=builder /app/package.json ./package.json +COPY --from=builder --chown=nextjs:nodejs /app . + +USER nextjs + +ENV PORT 3000 +# TODO : a changer en prod +# CMD ["npm", "start"] +CMD ["npm","run", "dev"] \ No newline at end of file diff --git a/code/interface_admin/package.json b/code/interface_admin/package.json index 1e91dc0..d100d6f 100644 --- a/code/interface_admin/package.json +++ b/code/interface_admin/package.json @@ -6,7 +6,6 @@ "dev": "next dev", "build": "next build", "start": "next start", - "export": "next export", "lint": "next lint" }, "dependencies": { diff --git a/docs/TODO_PAN4.md b/docs/TODO_PAN4.md index 5ba89a3..8b162e0 100644 --- a/docs/TODO_PAN4.md +++ b/docs/TODO_PAN4.md @@ -5,4 +5,4 @@ * Trouver un moyen d'intégrer les chiffres sur les mains a l'UX * Utiliser ça pour les notes critères, genre après le pouce donner la liste des critères et noter avec les doigts * Intégrer extraction de motes clés : surgligner / mettre en vert / rouge les mots quand regarde un message -* Récap des mots clés fréqents qq part : faire 2 nuagezs de mots, un pour les trucs positifs / négatifs avec la taille qui est fonction de l'importance \ No newline at end of file +* Récap des mots clés fréqents qq part : faire 2 nuagezs de mots, un pour les trucs positifs / négatifs avec la taille qui est fonction de l'importance \ No newline at end of file