Refactor Dockerfile, update README, and enhance Calculator component

- Refactored Dockerfile for improved multi-stage builds and added development and production configurations.
- Updated README with clearer project description, local development instructions, and added contact information.
- Enhanced Calculator component to manage theme and history using localStorage, improving user experience.
- Added new pages for legal mentions and privacy policy, including relevant metadata.
- Updated docker-compose.yml for better service management and added environment variables.
- Introduced a new LICENSE file outlining usage rights and responsibilities.
This commit is contained in:
Puechberty Arthur
2026-04-01 23:30:51 +02:00
parent 572f29c442
commit 8400e26c0a
9 changed files with 318 additions and 162 deletions
+16 -24
View File
@@ -1,34 +1,26 @@
# === Étape 1 : Build ===
FROM node:20-alpine AS builder
FROM node:22-alpine AS calculatrice-base
WORKDIR /app
ENV NEXT_TELEMETRY_DISABLED=1
# Copier les fichiers de dépendances pour profiter du cache Docker
COPY package*.json ./
# Installer uniquement ce qu'il faut pour le build
FROM calculatrice-base AS calculatrice-deps
COPY package.json package-lock.json ./
RUN npm ci
# Copier tout le code
FROM calculatrice-deps AS calculatrice-dev
COPY . .
EXPOSE 3000
CMD ["npm", "run", "dev", "--", "--hostname", "0.0.0.0", "--port", "3000"]
# Build Next.js pour la production
FROM calculatrice-deps AS calculatrice-builder
COPY . .
RUN npm run build
# === Étape 2 : Runner léger ===
FROM node:20-alpine AS runner
WORKDIR /app
# Copier uniquement ce qui est nécessaire pour la prod
COPY --from=builder /app/package*.json ./
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/public ./public
# Mode production
FROM calculatrice-base AS calculatrice-runner
ENV NODE_ENV=production
ENV HOSTNAME=0.0.0.0
ENV PORT=3000
COPY --from=calculatrice-builder /app/.next/standalone ./
COPY --from=calculatrice-builder /app/.next/static ./.next/static
COPY --from=calculatrice-builder /app/public ./public
EXPOSE 3000
# Lancer le serveur Next.js
CMD ["npm", "start"]
CMD ["node", "server.js"]