mirror of
https://git.roussel.pro/telecom-paris/pact.git
synced 2026-02-09 02:20:17 +01:00
modification du container interface admin
replacé apache par next start
This commit is contained in:
@@ -1,13 +1,10 @@
|
|||||||
FROM python:3.8
|
FROM python:3.8-alpine
|
||||||
|
|
||||||
#Ne pas créer les fichiers .pyc
|
#Ne pas créer les fichiers .pyc
|
||||||
ENV PYTHONDONTWRITEBYTECODE=1
|
ENV PYTHONDONTWRITEBYTECODE=1
|
||||||
#Afficher les logs directement dans le terminal
|
#Afficher les logs directement dans le terminal
|
||||||
ENV PYTHONUNBUFFERED=1
|
ENV PYTHONUNBUFFERED=1
|
||||||
|
|
||||||
#Installation des dépendances de opencv
|
|
||||||
RUN apt-get update
|
|
||||||
|
|
||||||
# Installation des dépendances python
|
# Installation des dépendances python
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
RUN python -m pip install -r requirements.txt
|
RUN python -m pip install -r requirements.txt
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM python:3.8
|
FROM python:3.8-slim
|
||||||
|
|
||||||
#Ne pas créer les fichiers .pyc
|
#Ne pas créer les fichiers .pyc
|
||||||
ENV PYTHONDONTWRITEBYTECODE=1
|
ENV PYTHONDONTWRITEBYTECODE=1
|
||||||
@@ -6,14 +6,21 @@ ENV PYTHONDONTWRITEBYTECODE=1
|
|||||||
ENV PYTHONUNBUFFERED=1
|
ENV PYTHONUNBUFFERED=1
|
||||||
|
|
||||||
#Installation des dépendances de opencv
|
#Installation des dépendances de opencv
|
||||||
RUN apt-get update
|
RUN apt-get update && apt-get install -y \
|
||||||
RUN apt-get install ffmpeg libsm6 libxext6 portaudio19-dev python3-pyaudio pulseaudio -y
|
ffmpeg \
|
||||||
|
libsm6 \
|
||||||
|
libxext6 \
|
||||||
|
portaudio19-dev \
|
||||||
|
python3-pyaudio \
|
||||||
|
gcc \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
|
||||||
# Installation des dépendances python
|
# Installation des dépendances python
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
RUN python -m pip install -r requirements.txt
|
RUN python -m pip install -r requirements.txt
|
||||||
# Création du répertoire de travail
|
# Création du répertoire de travail
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY . /app
|
COPY . .
|
||||||
|
|
||||||
CMD ["python", "main.py"]
|
CMD ["python", "main.py"]
|
||||||
|
|||||||
@@ -71,12 +71,15 @@ services:
|
|||||||
|
|
||||||
#Serveur web de l'interface admin
|
#Serveur web de l'interface admin
|
||||||
interface_admin:
|
interface_admin:
|
||||||
image: httpd:latest
|
build: ./interface_admin
|
||||||
volumes:
|
|
||||||
- ./interface_admin/out:/usr/local/apache2/htdocs/
|
|
||||||
container_name: interface_admin
|
|
||||||
ports:
|
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 de retour d'avis
|
||||||
formulaire:
|
formulaire:
|
||||||
@@ -113,10 +116,10 @@ services:
|
|||||||
# - HOST=backend_reconnaissance
|
# - HOST=backend_reconnaissance
|
||||||
# - API_HOST=reviews_api
|
# - API_HOST=reviews_api
|
||||||
# - API_PORT=8080
|
# - API_PORT=8080
|
||||||
|
# - CAMERA_ID=0
|
||||||
# ports:
|
# ports:
|
||||||
# #Ce container est le serveur websocker dont le client est l'interface de la borne qui tourne dans le navigateur
|
# #Ce container est le serveur websocker dont le client est l'interface de la borne qui tourne dans le navigateur
|
||||||
# - 5000:5000
|
# - 5000:5000
|
||||||
# user: root
|
|
||||||
|
|
||||||
video_loopback:
|
video_loopback:
|
||||||
build: ./video_loopback
|
build: ./video_loopback
|
||||||
|
|||||||
37
code/interface_admin/Dockerfile
Normal file
37
code/interface_admin/Dockerfile
Normal file
@@ -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"]
|
||||||
@@ -6,7 +6,6 @@
|
|||||||
"dev": "next dev",
|
"dev": "next dev",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"export": "next export",
|
|
||||||
"lint": "next lint"
|
"lint": "next lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
Reference in New Issue
Block a user