From b3619c738087004f8f4eb4cdb3c72f7984ff604c Mon Sep 17 00:00:00 2001 From: Mathieu Oriol Date: Mon, 9 Sep 2024 16:56:47 +0200 Subject: [PATCH] suppression reverse proxy (pour utiliser celui de rezel), maj node et netoyage --- docker-compose.yaml | 11 ++--------- traque-back/Dockerfile | 4 ++-- traque-front/Dockerfile | 22 ++++++---------------- 3 files changed, 10 insertions(+), 27 deletions(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 1e85fec..743ee0a 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -1,15 +1,8 @@ services: front: - build: ./traque-front - restart: always - - reverse_proxy: - build: ./proxy ports: - - "3000:443" - volumes: - # reusing the ssl files from the backend - - ./traque-back/ssl:/etc/nginx/ssl:ro + - "3000:3000" + build: ./traque-front restart: always back: diff --git a/traque-back/Dockerfile b/traque-back/Dockerfile index b7966f7..1463db3 100644 --- a/traque-back/Dockerfile +++ b/traque-back/Dockerfile @@ -1,5 +1,5 @@ -# Use Node 16 alpine as parent image -FROM node:16-alpine +# Use Node 20 alpine as parent image +FROM node:20-alpine # Change the working directory on the Docker image to /app WORKDIR /app diff --git a/traque-front/Dockerfile b/traque-front/Dockerfile index 3d1b852..f5f63d2 100644 --- a/traque-front/Dockerfile +++ b/traque-front/Dockerfile @@ -1,4 +1,4 @@ -FROM node:18-alpine AS base +FROM node:20-alpine AS base # Install dependencies only when needed FROM base AS deps @@ -7,13 +7,8 @@ RUN apk add --no-cache libc6-compat WORKDIR /app # Install dependencies based on the preferred package manager -COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./ -RUN \ - if [ -f yarn.lock ]; then yarn --frozen-lockfile; \ - elif [ -f package-lock.json ]; then npm ci; \ - elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \ - else echo "Lockfile not found." && exit 1; \ - fi +COPY package.json package-lock.json* ./ +RUN npm ci # Rebuild the source code only when needed @@ -25,14 +20,9 @@ COPY . . # Next.js collects completely anonymous telemetry data about general usage. # Learn more here: https://nextjs.org/telemetry # Uncomment the following line in case you want to disable telemetry during the build. -# ENV NEXT_TELEMETRY_DISABLED 1 +ENV NEXT_TELEMETRY_DISABLED 1 -RUN \ - if [ -f yarn.lock ]; then yarn run build; \ - elif [ -f package-lock.json ]; then npm run build; \ - elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm run build; \ - else echo "Lockfile not found." && exit 1; \ - fi +RUN npm run build # Production image, copy all the files and run next FROM base AS runner @@ -40,7 +30,7 @@ WORKDIR /app ENV NODE_ENV production # Uncomment the following line in case you want to disable telemetry during runtime. -# ENV NEXT_TELEMETRY_DISABLED 1 +ENV NEXT_TELEMETRY_DISABLED 1 RUN addgroup --system --gid 1001 nodejs RUN adduser --system --uid 1001 nextjs