mirror of
http://forgejo-oa09toasww4dgii9cj3gpzda.187.127.164.61.sslip.io/iamcoolvivek007/bharath.git
synced 2026-06-11 00:06:51 +00:00
Security: - Add CSRF protection on all forms - Fix session config (resave:false, saveUninitialized:false) - Secure cookie settings for production - Input sanitization middleware - Request logging middleware - Security headers via Helmet Code Quality: - Async error handling on ALL route handlers - Proper HTTP status codes (400, 401, 403, 404, 409, 500) - Input validation on all forms (server-side) - Username validation (3-30 chars, alphanumeric+underscore) - Password min length increased to 6 - Generic error messages (no info leakage) - Graceful shutdown on SIGTERM UI/UX: - Dark mode toggle with persistence - Toast notifications for success/error - Loading states on form submit - Improved CSS with CSS variables - Better desktop responsive design - New 403 Forbidden page - Pagination controls - Improved header with desktop nav Features: - Pagination on all list pages (loads, trips, users, messages, etc.) - Admin stats JSON endpoint - Admin user delete route - Load cancel route - Mark invoice as paid route - Search/filter preserved on loadboard Database: - Additional composite indexes for performance - Updated timestamps trigger on trips - Improved FULL migration script DevEx: - Development seed script (seed.js) - Improved Dockerfile (non-root, healthcheck) - Comprehensive .gitignore - Updated README v2.0
25 lines
549 B
Docker
25 lines
549 B
Docker
# syntax=docker/dockerfile:1
|
|
FROM node:22-alpine AS base
|
|
|
|
WORKDIR /app
|
|
|
|
# Install dependencies first (layer caching)
|
|
COPY package.json ./
|
|
RUN npm ci --omit=dev && npm cache clean --force
|
|
|
|
# Copy application
|
|
COPY src ./src
|
|
|
|
# Create non-root user
|
|
RUN addgroup -S app && adduser -S app -G app
|
|
USER app
|
|
|
|
# Metadata
|
|
ENV NODE_ENV=production
|
|
EXPOSE 3000
|
|
|
|
# Healthcheck
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/health || exit 1
|
|
|
|
CMD ["node", "src/server.js"]
|