Metabase App Database Connection Values
✅ Solution Implemented
A second socat instance has been added to forward port 5433 to the application database. This allows Metabase to connect to both:
- Port 5432: Metabase metadata database (automatic)
- Port 5433: Application database (for your FlowPOS data)
For Staging Environment
Use these exact values in the Metabase UI when adding your FlowPOS app database:
Connection Values
Display name: FlowPOS Staging DB (or any name you prefer)
Host: 127.0.0.1
Port: 5433 ← Important: Use port 5433, not 5432!
Database name: flowpos_staging
Username: flowpos_staging
Password: [Your password from Doppler/backend secrets]
Schemas: All (or public if you want only the public schema)
Use a secure connection (SSL): ❌ Unchecked (disabled)
Use an SSH-tunnel: ❌ Unchecked (not needed)
For Production Environment
Same as staging, but use:
- Port:
5433 - Database name:
flowpos_production - Username:
flowpos_production - Password: [Your production password]
Getting the Password
The password for the database user should be in your backend's Doppler secrets or GitHub secrets as part of the DATABASE_URL_STAGING or DATABASE_URL_PRODUCTION connection string.
To extract it:
# Staging
doppler secrets get DATABASE_URL_STAGING --project flowpos-workspace --config staging --plain
# Production
doppler secrets get DATABASE_URL_PRODUCTION --project flowpos-workspace --config production --plain
How It Works
- Dockerfile now includes a
start_socat()function that can forward multiple ports - Port 5432 → Metabase metadata database (required for Metabase to run)
- Port 5433 → Application database (for querying your FlowPOS data)
- Workflow passes
CLOUD_SQL_INSTANCE_APPenvironment variable to enable the second socat instance
Testing the Connection
After deployment:
- Go to Metabase UI → Settings → Admin → Databases → Add Database
- Fill in the values above
- Click "Test Connection"
- You should see: ✅ "Successfully connected to the database."
Troubleshooting
If the connection fails:
- Verify
CLOUD_SQL_INSTANCE_APPis set in the Cloud Run service environment variables - Check Metabase logs for socat startup messages
- Ensure both Cloud SQL instances are added to
--add-cloudsql-instancesin the deployment - Verify the password is correct