Overview
Money Tracker uses Docker Compose to run both the frontend and Supabase stack locally. This approach requires no local installation of Bun or the Supabase CLI.Prerequisites
- Docker Desktop or Docker Engine installed
- Docker Compose v2.0 or later
Docker services
Thedocker-compose.yml file defines two main services:
Frontend service
Builds fromDockerfile.frontend and runs the React application with Bun.
- Image:
oven/bun:1.3.9 - Port:
3000:3000 - Hot reload: Enabled via volume mount
- Dependencies: Waits for
supabase-cliservice
Supabase CLI service
Builds fromDockerfile.supabase-cli and manages the local Supabase stack.
- Image:
node:20-alpinewith Supabase CLI - Network mode:
host(required for health checks) - Docker access: Mounts
/var/run/docker.sockfor nested containers - Working directory: Uses
PROJECT_ROOTenvironment variable
Starting the stack
Set up environment files
Copy the example environment files:Edit each
.env file with your actual credentials. See the Environment Variables page for details.Start Docker Compose
Run the following command from the project root:This starts:
- Frontend at
http://localhost:3000 - Supabase Studio at
http://127.0.0.1:54323 - Supabase API at
http://127.0.0.1:54321
Stopping the stack
To stop all containers:Using npm/bun scripts
Thepackage.json includes convenience scripts that handle the PROJECT_ROOT variable:
Accessing the Supabase CLI container
You can run commands inside the Supabase CLI container:Troubleshooting
Frontend fails to connect to Supabase
Frontend fails to connect to Supabase
- Verify
packages/frontend/.envexists with validSUPABASE_URLandSUPABASE_ANON_KEY - Check that Supabase is running:
docker compose ps - View Supabase logs:
docker compose logs supabase-cli
Port already in use errors
Port already in use errors
If ports 3000, 54321, 54322, or 54323 are already in use:
- Stop conflicting services
- Or modify the port mappings in
docker-compose.ymlandsupabase/config.toml
Permission denied on docker.sock
Permission denied on docker.sock
On Linux, ensure your user is in the
docker group:Nested mount issues on macOS
Nested mount issues on macOS
Ensure Docker Desktop has file sharing enabled for your project directory in Settings > Resources > File Sharing.
Docker image details
Dockerfile.frontend
Dockerfile.supabase-cli
The
sleep infinity command keeps the container running. The actual Supabase start command is overridden in docker-compose.yml.