Files
portfolio/Dockerfile
T
Puechberty ArthurandCopilot c69770f02f refactor: update photo gallery and reduce image count
- Reduced the number of photos displayed from 68 to 33 in the photo gallery.
- Removed unused photo files (photos 34 to 68) from the public directory.
- Updated Docker configuration for better environment management and container naming.
- Upgraded Next.js and ESLint dependencies to their latest versions.
- Added ESLint configuration file for improved code quality checks.
- Introduced a .dockerignore file to exclude unnecessary files from the Docker context.
- Added an example .env file for environment variable configuration.

Co-authored-by: Copilot <copilot@github.com>
2026-04-29 20:53:24 +02:00

44 lines
778 B
Docker

# ====== 1. Dependencies ======
FROM node:20-alpine AS deps
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci
# ====== 2. Build ======
FROM node:20-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
# Variables build-time
ENV NEXT_TELEMETRY_DISABLED=1
RUN npm run build
# ====== 3. Runner (prod minimal) ======
FROM node:20-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
# user non-root (bonne pratique)
RUN addgroup -S nextjs && adduser -S nextjs -G nextjs
# Copy standalone output
COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
USER nextjs
EXPOSE 3000
CMD ["node", "server.js"]