// MongoDB initialization script — runs once when the container is first created. db = db.getSiblingDB('lad_db'); if (db.getUser(process.env.MONGO_USER || 'lad_admin') == null) { db.createUser({ user: process.env.MONGO_USER || 'lad_admin', pwd: process.env.MONGO_PASSWORD || 'changeme', roles: [{ role: 'readWrite', db: 'lad_db' }] }); } // Collections are created automatically by Mongoose on first write. // Index definitions live in the model files. // This script exists to create the DB user and is safe to re-run. console.log('LAD MongoDB initialization complete.');