SmartController-SIH — Docker setup
This repository contains a Vite + React frontend and a Node/Express backend using SQLite for demo persistence.
Files added:
Dockerfile.frontend— builds the frontend and serves it with nginx on port 80.server/Dockerfile— builds the backend image and runsnode index.cjson port 3000.docker-compose.yml— orchestrates frontend + backend; mounts./server/datato persist the SQLite DB.
Quick start (requires Docker & docker-compose):
Build and start:
# From repository root
docker compose build --progress=plain
docker compose up -dVisit:
- Frontend: http://localhost:8080
- Backend API: http://localhost:3000
Seeded demo credentials (created on first run):
- empID: admin
- password: admin123
Notes:
- For production, replace
JWT_SECRETindocker-compose.ymlwith a secure secret and consider using a managed database (Postgres) instead of SQLite. - To preserve DB between container runs ensure
./server/dataexists and is writable by your user.
Troubleshooting:
- If the backend fails to start, check logs: docker compose logs backend
- To rebuild after code changes: docker compose up -d --build