Set up initial frontend with Vite and integrated Docker for full-stack build

This commit is contained in:
alexandre grondin
2026-04-19 22:24:59 +02:00
commit ac63c4be99
37 changed files with 9796 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
# Build context : racine du projet (budget-commun/)
# ── Stage 1 : Build React ─────────────────────────────────────
FROM node:20-alpine AS frontend-builder
WORKDIR /build
COPY frontend/package.json .
RUN npm install
COPY frontend .
RUN npx vite build --outDir /dist --emptyOutDir
# ── Stage 2 : Backend Node.js ──────────────────────────────────
FROM node:20-alpine
WORKDIR /app
COPY backend/package.json .
RUN npm install --production
COPY backend .
COPY --from=frontend-builder /dist ./public
EXPOSE 3000
CMD ["node", "server.js"]