Prerequisites
- Docker Engine 20.10+
- Docker Compose 2.0+
- At least 4GB RAM available for containers
.envfile configured (see Environment setup)
Quick start
The application will be available athttp://localhost:3000
Development mode
Local database (recommended)
Starts both the application and a PostgreSQL + PostGIS container:- ✅ Automatically runs migrations
- ✅ Seeds the database with sample data
- ✅ Hot-reloads code changes
- ✅ Includes Prisma Studio on port 5555
The local database uses Docker volumes for persistence. Data survives container restarts but will be lost if you run
./run.sh --clean.Remote database
Connects to an existing database usingDATABASE_URL from .env:
Force rebuild
Rebuild containers after changing dependencies:Production mode
- Builds optimized Next.js production bundle
- Runs with
NODE_ENV=production - Disables hot-reload and development tools
- Uses standalone output for minimal image size
Running multiple instances
Therun.sh script automatically detects port conflicts and finds available ports. This enables running multiple instances simultaneously (useful for git worktrees):
Docker Compose profiles
OpenCouncil uses Docker Compose profiles to control which services run:| Profile | Services | Use case |
|---|---|---|
dev | app-dev | Development with hot-reload |
prod | app | Production build |
with-db | db | Local PostgreSQL + PostGIS |
Running just the database
Use the database container independently:Running commands in containers
Theexec.sh script provides a convenient way to run commands inside containers:
exec.sh script:
- Loads environment variables from
.env - Starts the container if not running
- Executes commands with the proper environment
Database connection modes
The Docker setup handles database connections automatically based on the mode:Local database mode (./run.sh)
Connection strings are automatically constructed from initialization variables:
Remote database mode (./run.sh --remote-db)
Uses connection strings directly from .env:
You can keep your
.env configured for remote databases. The local mode automatically overrides these values.Docker networks
OpenCouncil uses Docker networks for service communication:Default shared network
All instances shareopencouncil-net by default:
Custom networks (isolated development)
Isolate instances with custom networks:opencouncil-net- (e.g., opencouncil-net-feature-auth).
Connecting to the task server
Configureopencouncil-tasks to use the same network:
docker-compose.yml
.env:
Cleaning up resources
Remove all Docker resources for the current directory:- Stops and removes containers
- Removes volumes (including database data)
- Removes networks
- Removes configuration files
Troubleshooting
Port already in use
The script automatically finds available ports. If you manually specify a port that’s in use:Container won’t start
Check logs:Database connection failed
Verify database is running:Cached data after switching databases
Clear Next.js cache:Next steps
Environment setup
Configure environment variables
Database setup
Migrations and seeding