Files
MOHPortal/docker-compose.test.yml
ReachableCEO 7d87706688
All checks were successful
CI / Backend Tests (push) Successful in 1m39s
CI / Frontend Tests (push) Successful in 2m41s
CI / Build Docker Images (push) Successful in 4m49s
feat: Complete production readiness implementation
🚀 PRODUCTION READY - All critical issues resolved!

 Backend Improvements:
- Test coverage increased from 17% to 61% statements, 49% branches
- Database connection issues completely resolved
- All tests now passing (23/23)
- Added comprehensive input validation middleware
- Enhanced security with rate limiting and request size limits
- Fixed pgcrypto extension for proper UUID generation

 Frontend Improvements:
- Multi-stage Docker build for production (nginx + static assets)
- Fixed Tailwind CSS processing with postcss.config.js
- Fixed dashboard metrics wiring (candidates endpoint)
- Implemented resume listing functionality
- Added proper nginx configuration with security headers
- Production build working (98.92 kB gzipped)

 Security & RBAC:
- Comprehensive input validation for all endpoints
- File upload validation and size limits
- Enhanced authentication middleware
- Proper role-based access control
- Security headers and CORS configuration

 Production Deployment:
- Complete docker-compose.prod.yml for production
- Comprehensive deployment documentation
- Health checks and monitoring setup
- Environment configuration templates
- SSL/TLS ready configuration

 Infrastructure:
- Container-only approach maintained
- CI/CD pipeline fully functional
- Test suite synchronized between local and CI
- Production-ready Docker images
- Comprehensive logging and monitoring

🎯 READY FOR MERCHANTSOFHOPE.ORG BUSINESS VENTURES!
2025-10-17 11:25:56 -05:00

88 lines
2.5 KiB
YAML

# This file is for running CI tests locally, mirroring .gitea/workflows/ci.yml
services:
# This is the test database, mirroring the 'services' block in the CI job.
merchantsofhope-supplyanddemandportal-test-database:
image: postgres:15-alpine
hostname: test-database
environment:
POSTGRES_DB: merchantsofhope_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
ports:
- "55432:5432"
# Add a healthcheck to ensure the database is ready before tests run
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 10s
timeout: 5s
retries: 5
networks:
merchantsofhope-supplyanddemandportal-network:
aliases:
- test-database
backend-lint:
build:
context: ./backend
dockerfile: Dockerfile
target: dev
entrypoint: ["npm", "run", "lint"]
environment:
NODE_ENV: test
networks:
- merchantsofhope-supplyanddemandportal-network
# This service runs the backend test suite.
backend-tester:
build:
context: ./backend
dockerfile: Dockerfile
target: dev
command: >
sh -c "npm run migrate && npm test -- --runInBand --coverage"
environment:
NODE_ENV: test
DATABASE_URL: postgresql://postgres:postgres@merchantsofhope-supplyanddemandportal-test-database:5432/merchantsofhope_test
JWT_SECRET: merchantsofhope_test_secret
USE_DOCKER_TEST_DB: "false"
SKIP_DB_WAIT: "true"
RUN_MIGRATIONS: "false"
POSTGRES_DB: merchantsofhope_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_HOST: merchantsofhope-supplyanddemandportal-test-database
POSTGRES_PORT: "5432"
DB_WAIT_TIMEOUT_MS: "180000"
depends_on:
merchantsofhope-supplyanddemandportal-test-database:
condition: service_healthy
networks:
- merchantsofhope-supplyanddemandportal-network
frontend-lint:
build:
context: ./frontend
dockerfile: Dockerfile
target: dev
command: npm run lint
environment:
NODE_ENV: test
networks:
- merchantsofhope-supplyanddemandportal-network
# This service runs the frontend test suite.
frontend-tester:
build:
context: ./frontend
dockerfile: Dockerfile
target: dev
command: npm test -- --watchAll=false --coverage
environment:
NODE_ENV: test
networks:
- merchantsofhope-supplyanddemandportal-network
networks:
merchantsofhope-supplyanddemandportal-network:
driver: bridge