docker compose up -d
docker compose psThis brings up app and Postgres consistently.
Pick one style and stick to it:
npm run dev.envshould use alocalhostDB URL.
- Run the app inside the container.
DATABASE_URLincompose.yamlshould usedb.
- Edit
prisma/schema.prisma - Run migration
- Generate Prisma client
- Inspect in Studio
npx prisma migrate dev --name <clear_name>
npx prisma generate
npx prisma studioFor this chat app:
- DB write path first
- Socket emit second
- UI update third
- Test manually with 2 browser tabs
- Check app starts cleanly
- Test one happy path and one edge case
- Ensure migrations are present in
prisma/migrations/* - Commit code and migration together
- Host commands (
npm,npx prisma ...on PowerShell) ->localhost - In-container runtime (
docker compose exec server ...) ->db
Keep this mental rule and you will avoid most environment bugs.
docker compose down- You can keep services running if preferred.
- Optional weekly cleanup:
docker system prune(careful). - Push your branch with migration files included.