- Fixed LoginPage.js to use correct API endpoint (localhost:8000) - Fixed prop naming (onLoginSuccess → onLogin) - Fixed data structure mapping (voter.email → email, etc) - Removed duplicate src/ folder structure - Updated DashboardPage.js with proper API endpoints - Added lucide-react dependency - Fixed docker-compose and Dockerfile.backend for proper execution - Cleaned up console logs - System fully working with Docker deployment
35 lines
630 B
Docker
35 lines
630 B
Docker
FROM node:20-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
# Copier package.json
|
|
COPY frontend/package*.json ./
|
|
|
|
# Installer dépendances
|
|
RUN npm install --legacy-peer-deps
|
|
|
|
# Copier code source
|
|
COPY frontend/ .
|
|
|
|
# Clean previous builds
|
|
RUN rm -rf build/
|
|
|
|
# Build argument for API URL
|
|
ARG REACT_APP_API_URL=http://backend:8000
|
|
ENV REACT_APP_API_URL=${REACT_APP_API_URL}
|
|
|
|
# Force rebuild timestamp (bust cache)
|
|
ARG CACHEBUST=1
|
|
ENV CACHEBUST=${CACHEBUST}
|
|
|
|
# Build avec npm run build (CRA standard)
|
|
RUN npm run build
|
|
|
|
# Installer serve pour servir la build
|
|
RUN npm install -g serve
|
|
|
|
EXPOSE 3000
|
|
|
|
# Servir la build
|
|
CMD ["serve", "-s", "build", "-l", "3000"]
|