Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Supabase database expose #3297

Closed
1 of 2 tasks
alvarolozano opened this issue Sep 3, 2024 · 10 comments · Fixed by #4598
Closed
1 of 2 tasks

[Bug]: Supabase database expose #3297

alvarolozano opened this issue Sep 3, 2024 · 10 comments · Fixed by #4598

Comments

@alvarolozano
Copy link

alvarolozano commented Sep 3, 2024

Description

I created a Supabase instance, and my goal was to expose the PostGres database to access it from PGAdmin.

When Supabase is deployed, the PostGres container offers a checkbox to enter the port and expose it directly, but it's not working... I had to manually expose it by modifying the docker compose file.

Minimal Reproduction (if possible, example repository)

  1. Create the Supabase instance
  2. From the stack view, select the PostGres container and click "settings"
  3. Type a port number and mark the ckeckbox to expose the port
    image

Exception or Error

I thought it was something related with the PostGres config, but the port is not being exposed.

Version

v4.0.0-beta.325

Cloud?

  • Yes
  • No
@djsisson
Copy link
Contributor

djsisson commented Sep 3, 2024

it looks like it doesnt set internal port here:

if ($type === 'App\Models\StandaloneRedis') {

due to this not being one of teh standalone database types

@grantmagdanz
Copy link
Contributor

Running into this same issue

@justinline
Copy link

Can confirm, had to edit the docker-compose file to expose the port (using coolify cloud)

@alvarolozano
Copy link
Author

I will check the behaviour with other services... I don't know how it should work internally, but maybe, it is supposed to write into the compose file the expose rule with the desired port.

@djsisson
Copy link
Contributor

@alvarolozano its starts a nginx container so you don't have to start or stop the service, the publicly available is on demand, however it doesn't work for this as there is no internal port specified

@scorpionate
Copy link

scorpionate commented Sep 18, 2024

Same here. Following: https://supabase.com/docs/guides/self-hosting/docker. I have added manually in Coolify's docker-compose editor. My steps from the scratch:

  1. Create new project from the template.
  2. Modify docker-compose:
  supabase-db:
    ports:
      - ${POSTGRES_PORT:-5432}:${POSTGRES_PORT:-5432}
  1. Edit DB port in ENV, because 5432 was busy in my case.
  2. URL is
postgresql://supabase_admin:{SERVICE_PASSWORD_POSTGRES}@{YOUR_HOST}:{POSTGRES_PORT}/{POSTGRES_DB}

Name reflects ENV names in Coolify cloud.

@djsisson
Copy link
Contributor

djsisson commented Sep 22, 2024

i'll just add, this is the auto generated nginx.conf for supabase

user  nginx;
worker_processes  auto;

error_log  /var/log/nginx/error.log;

events {
    worker_connections  1024;
}
stream {
   server {
        listen 5432;
        proxy_pass rcoc880:;
   }
}

the tag rcoc880 is part of the url in the browser but is not the supabase-db containerid and as you can see it's also missing the port as suspected

@LazerJesus
Copy link

I had to apply this fix, but now it works fine. just a question for my understanding:

when does coolify write these docker-compose files? are they written once when i instantiate the service from the coolify UI, or are they written at any other point?
how reliable a fix is it to go into the filesystem and manually overwrite config managed by coolify? are there hidden caches or something?

@djsisson
Copy link
Contributor

@LazerJesus i dont follow your question, once the template is in your project, no other changes occur unless you change it
you dont need to go into file system to change it, you need to do it in coolify ui, and press save and redeploy

@tao101
Copy link

tao101 commented Dec 20, 2024

i'll just add, this is the auto generated nginx.conf for supabase

user  nginx;
worker_processes  auto;

error_log  /var/log/nginx/error.log;

events {
    worker_connections  1024;
}
stream {
   server {
        listen 5432;
        proxy_pass rcoc880:;
   }
}

the tag rcoc880 is part of the url in the browser but is not the supabase-db containerid and as you can see it's also missing the port as suspected

@djsisson where can i find the nginx.conf file in coolify ?

@peaklabs-dev peaklabs-dev added the 🐞 Confirmed Bug Verified issues that have been reproduced by the team. label Jan 9, 2025
@peaklabs-dev peaklabs-dev added this to the v4.X.X milestone Jan 9, 2025
@github-actions github-actions bot removed the 🐞 Confirmed Bug Verified issues that have been reproduced by the team. label Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants