Docker quickstart
Run the development stack with its database, seed data and separate integration-test database.
Edit on GitHubUse docker-compose.local.yml to run the application and PostgreSQL on your machine. This is a development stack. It builds the application from your checkout, applies the repository's SQL migrations and runs the development seed before starting the server. For a production deployment, use the Docker production guide.
Prepare the checkout
Install Docker with Compose, then clone the repository. The local compose file reads a root .env file for the application container. Supply the application variables it needs, including NEXTAUTH_SECRET, NEXTAUTH_URL and SEED_USER_PASSWORD. The seed script requires a password source before it can create development accounts. It first reads prisma/seed/.credentials when present; SEED_USER_PASSWORD is the fallback used by staging and local compose. A leftover credentials file wins. Give it a value that meets the application's password rules. Do not use the seeded accounts or the compose database defaults for production.
The local compose file sets DATABASE_URL inside the application container to its own postgres service, which uses database tea_dev and user tea_user. The host-facing database port is 5432. It also defines a separate postgres-test service on host port 5433 for integration tests. That test database is disposable and does not hold your development cases.
Start the stack
From the repository root, build and start the local services:
docker compose -f docker-compose.local.yml up -d --buildThe application is available at http://localhost:3000 after the build, migration and seed finish. The image uses a production Next.js build in the container. It does not bind mount source files, so rebuild with the same command after changing the checkout. If you need hot reload, run the dev package script on the host against the local PostgreSQL service as described in local development.
The seed creates development users including chris, alice, bob and charlie, plus sample cases and sharing relationships. Their password comes from the seed password source described above.
Checks and shutdown
Follow the application logs if the page does not load. A failed seed or migration stops the container before Next.js starts. The application image runs prisma migrate deploy automatically; do not run prisma migrate dev inside it. For a routine stop that preserves the named development database volume, use:
docker compose -f docker-compose.local.yml downAdding -v to down removes the named database volume and its development data. Use that reset only when you intend to discard those cases; the postgres-test data is disposable already.
For code checks, use the exact package scripts listed in the code style guide. Start the separate test database, then run integration tests:
docker compose -f docker-compose.local.yml up -d postgres-test
pnpm test:integration