Core Infrastructure
These variables cover databases, caches, and host port mappings used by the Docker stack. Most of them can stay at their defaults unless you have port conflicts or custom credentials.
Postgres (POSTGRES_USER, POSTGRES_PASSWORD, POSTGRES_DB, POSTGRES_PORT)
- Pick credentials you are comfortable using for local development. Example:
POSTGRES_USER=app
POSTGRES_PASSWORD=changeme
POSTGRES_DB=ii
POSTGRES_PORT=5432 - Update the same values anywhere else they appear (e.g., in Prisma configs or backend
.envfiles) so services can authenticate. - If port
5432conflicts with a local Postgres install, changePOSTGRES_PORTto something else (like55432) and adjust your clients accordingly.
DATABASE_URL
- Async connection string used by the backend (e.g.,
postgresql+asyncpg://app:changeme@postgres:5432/ii). - Ensure the host matches the service name inside Docker (
postgresby default) instead oflocalhost.
Sandbox database (SANDBOX_DB_NAME, SANDBOX_DATABASE_URL)
- Only needed if your sandbox service uses a dedicated database.
- You can reuse the primary Postgres instance by pointing the URL at the same host but a different database name.
Redis (REDIS_PORT)
- Defaults to
6379. Change only when another local service already uses that port. - Clients inside Docker talk to the service name
redis, so you only need to update host mappings if you connect from the host machine.
HTTP-facing ports
BACKEND_PORT,FRONTEND_PORT,SANDBOX_SERVER_PORT,TOOL_SERVER_PORT,NGROK_METRICS_PORT,MCP_PORT- Map each to a free host port. The defaults from
.stack.env.exampleusually work (8000/3000/etc.). - When a port collision occurs, bump the conflicting value and restart the stack. Remember to update any URLs (e.g.,
VITE_API_URL) that reference the old port.
Validation Checklist
- Run
./scripts/run_stack.sh --buildand verify each container starts without port binding errors. - Use
docker compose psto confirm Postgres and Redis listen on the expected ports. - From your host, connect to each service (
psql,redis-cli,curl http://localhost:<port>) to ensure mappings work.