2026-04-15-2 dashboard convert to html without vite and react

This commit is contained in:
Hamza-Ayed
2026-04-15 15:41:05 +03:00
parent 3802af0651
commit f1f1818501
13 changed files with 5126 additions and 220 deletions
+16 -13
View File
@@ -1,18 +1,21 @@
FROM node:20-alpine
FROM nginx:alpine
WORKDIR /app
# Remove default nginx static assets
RUN rm -rf /usr/share/nginx/html/*
# Install dependencies placeholder
COPY apps/dashboard/package*.json ./
RUN npm install
# Copy static assets into nginx
COPY apps/dashboard/index.html /usr/share/nginx/html/
COPY apps/dashboard/js /usr/share/nginx/html/js/
COPY apps/dashboard/css /usr/share/nginx/html/css/
# Copy source
COPY apps/dashboard/ .
# Fix networking issues by adding a simple redirect for spa if needed
# But for hash-based routing, default index.html is enough.
# We also need to handle the API proxy if we want to avoid CORS issues
# However, the user's docker-compose has the API and Dashboard on different ports.
# In a real production, we'd use Nginx to proxy /api to the backend.
# Build for production
RUN npm run build
COPY infrastructure/docker/dashboard/nginx.conf /etc/nginx/conf.d/default.conf
# We use a simple static server or just serve from Vite for demo
# For production, we can use nginx, but let's stick to dev/preview mode for now
# per user request to see "what happens"
CMD ["npm", "run", "preview", "--", "--host", "--port", "5173"]
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]