suppression reverse proxy (pour utiliser celui de rezel), maj node et netoyage

This commit is contained in:
Mathieu Oriol
2024-09-09 16:56:47 +02:00
parent 0921cfa54c
commit b3619c7380
3 changed files with 10 additions and 27 deletions

View File

@@ -1,15 +1,8 @@
services: services:
front: front:
build: ./traque-front
restart: always
reverse_proxy:
build: ./proxy
ports: ports:
- "3000:443" - "3000:3000"
volumes: build: ./traque-front
# reusing the ssl files from the backend
- ./traque-back/ssl:/etc/nginx/ssl:ro
restart: always restart: always
back: back:

View File

@@ -1,5 +1,5 @@
# Use Node 16 alpine as parent image # Use Node 20 alpine as parent image
FROM node:16-alpine FROM node:20-alpine
# Change the working directory on the Docker image to /app # Change the working directory on the Docker image to /app
WORKDIR /app WORKDIR /app

View File

@@ -1,4 +1,4 @@
FROM node:18-alpine AS base FROM node:20-alpine AS base
# Install dependencies only when needed # Install dependencies only when needed
FROM base AS deps FROM base AS deps
@@ -7,13 +7,8 @@ RUN apk add --no-cache libc6-compat
WORKDIR /app WORKDIR /app
# Install dependencies based on the preferred package manager # Install dependencies based on the preferred package manager
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./ COPY package.json package-lock.json* ./
RUN \ RUN npm ci
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
# Rebuild the source code only when needed # Rebuild the source code only when needed
@@ -25,14 +20,9 @@ COPY . .
# Next.js collects completely anonymous telemetry data about general usage. # Next.js collects completely anonymous telemetry data about general usage.
# Learn more here: https://nextjs.org/telemetry # Learn more here: https://nextjs.org/telemetry
# Uncomment the following line in case you want to disable telemetry during the build. # 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 \ RUN npm run build
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
# Production image, copy all the files and run next # Production image, copy all the files and run next
FROM base AS runner FROM base AS runner
@@ -40,7 +30,7 @@ WORKDIR /app
ENV NODE_ENV production ENV NODE_ENV production
# Uncomment the following line in case you want to disable telemetry during runtime. # 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 addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nextjs RUN adduser --system --uid 1001 nextjs