Local supabase url

Has anyone else used this with a local setup. For my pgAdmin container I use supabase-db:5432 but it strangled Archon.

I sorted it out and another great reason to have Portainer in your docker stack for local-ai. Since the script starts the whole Archon container I added a default network to the cmd to start the container so itā€™s on the same network. Then in Portainer take the ip address for supabase-db and it connects fine with your SERVICE_ROLE_KEY from the supabase .env.
Should be something like

http://112.20.8.22:5432

which is the internal docker address which again is super easy to sort out from Portainer

print("\n=== Starting Archon container ===")
cmd = [
    "docker", "run", "-d",
    "--name", "archon-container",
    "--network", "localai_default",  # force Archon to the localai_default network        
    "--gpus", "all",  # Pass GPU access
    "-e NVIDIA_VISIBLE_DEVICES=all",
    "-e NVIDIA_DRIVER_CAPABILITIES=compute,utility",
    "-e NVIDIA_REQUIRE_CUDA=\"cuda>=12.8\"",  # Force CUDA 12.8
    "-p", "8501:8501",
    "-p", "8100:8100",
    "--add-host", "host.docker.internal:host-gateway"
]

Can we add a DEFAULT_DB=supabase
POSTGRES_DB=supbase

Iā€™m actually new to Portainer! Could you help me understand how it helps here?

OKā€¦you have all the stacks, containers, images, networks, volumes and logs. You can super easily start, pause(look in another stack for continuing errorsā€¦f$%&king supabase), resume, restart and remove containers and it highlights orphans and unused volumes. All the local container IPā€™s are right there as well as the network they are connected which helped me when starting Archon from a script which causes it to be on a bridge network rather than the localai_default I setup for your initial local-ai-packaged stack. I did that to make sure the loca-ai stack and your supabase script all land together for no conflicts but anything that might land on another network can be re-assigned and then pointed to the one you want. I have 22 containers in total and while desktop has similar features they are not quite as accessible and the network re-assignment and ip addressing resolution is awesome.

portainer:
image: portainer/portainer-ce
container_name: portainer
restart: unless-stopped
networks:
- localai_default # Ensure it is in the correct network
ports:
- ā€œ9443:9443ā€ # Web UI (HTTPS)
- ā€œ8000:8000ā€ # Edge agent
volumes:
- /var/run/docker.sock:/var/run/docker.sock # Allows Portainer to manage Docker
- portainer_data:/data # Persistent storage

Screenshot_20250310_064143
Hereā€™s where Portainer is very handyā€¦been debugging this connection to supabase and of course I had the wrong hostā€¦this needs too connect to supabase-kong:8001 and then I start getting activity and I can just look at the container list and see that .08 is my Archon and .03 is my supabase-vector. problem of course 200 to vector and 401 to Archonā€¦progress anyway,

1 Like

Glad youā€™re making progress! Sure seems like I need to look into using Portainer.

Authentication is absolutely killing me right nowā€¦ :skull_and_crossbones:
I have it connecting but cannot for the life of me figure out what the heck this thing is looking for I have worn out the supabase key generator and it just keeps telling me ā€œError checking table status: {ā€˜messageā€™: ā€˜Invalid authentication credentialsā€™}ā€ The table and schema and all the columns are created and I even disable rls and I still canā€™t link up. any thoughts would be greatly appreciated.

172.18.0.24 is my Archon container so it's tickling it...
{
  "appname": "supabase-kong",
  "event_message": "172.18.0.24 - - [10/Mar/2025:23:25:20 +0000] \"GET /rest/v1/site_pages?select=id&limit=1 HTTP/1.1\" 401 52 \"-\" \"python-httpx/0.27.2\"",
  "id": "c08de93b-f946-4d7b-8b4e-36088d9777fc",
  "metadata": {
    "request": {
      "headers": {
        "cf_connecting_ip": "172.18.0.24",
        "user_agent": "python-httpx/0.27.2"
      },
      "method": "GET",
      "path": "/rest/v1/site_pages?select=id&limit=1",
      "protocol": "HTTP/1.1"
    },
    "response": {
      "status_code": 401
    }
  },
  "project": "default",
  "timestamp": 1741649120000000
}

Hard to say without looking into your setup and config moreā€¦ but what I will say is that Iā€™m planning on hooking Archon into the local AI stack soon so Iā€™ll let you know if I run into any issues myself and Iā€™ll also be putting out a guide once I get it set up!

I found the issue but for whatever reason canā€™t flush thisā€¦Again in Portainer I can see the environment variables plain as day and what I have loaded in rest is:
ā€œPGRST_DB_URI=postgres://authenticator:2020@supabase-db:5432/postgresā€
Which originates in compose:PGRST_DB_URI: postgres://authenticator:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}

and is fed by .env

POSTGRES_DB=_supabase

How does PGRST_DB_URI=xxxxx/postgres when it is defined as _supabase

Sorry could you clarify what exactly is wrong here? Are you saying you expect PGRST_DB_URI to be something different?