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

Docker build instructions outdated #580

Open
kjcsb1 opened this issue Mar 10, 2023 · 12 comments
Open

Docker build instructions outdated #580

kjcsb1 opened this issue Mar 10, 2023 · 12 comments

Comments

@kjcsb1
Copy link

kjcsb1 commented Mar 10, 2023

The Docker build instructions on the wiki are out-of-date now that 15 is released.

Is it as simple as running docker build --tag custom-postgres:latest .?

That didn't work for me. I get an 80MB Docker image with only the extensions included, no Postgres.

Any suggestions appreciated.

@jbergstroem
Copy link

I still think you need to build through Ansible; check how the Dockerfile assumes certain args

@allquantor
Copy link

+1 on this.

@rienheuver
Copy link

Can someone help me understand why you'd want to user Docker for the database? Isn't that quite risky? In that when docker restarts, all your data is gone

@jbergstroem
Copy link

jbergstroem commented May 17, 2023

Can someone help me understand why you'd want to user Docker for the database? Isn't that quite risky? In that when docker restarts, all your data is gone

You would mount a persistent volume into the running instance of your container, making storage permanent;

$ docker volume create db
$ docker run -v db:/var/lib/postgresql ...

@rienheuver
Copy link

Right, that does make a lot more sense. Is there any documentation on how to do that? And if so, couldn't you do this using the regular Docker compose of supabase?

@jbergstroem
Copy link

Right, that does make a lot more sense. Is there any documentation on how to do that?

And if so, couldn't you do this using the regular Docker compose of supabase?

It already is!

https://github.com/supabase/supabase/blob/677a2288865d8d22f0ccedd575839d2da89ff377/docker/docker-compose.yml#L291-L298

@rienheuver
Copy link

Then why'd you need to decouple your database? Or am I overlooking something now?

@jbergstroem
Copy link

Then why'd you need to decouple your database? Or am I overlooking something now?

Yeah, I'm not quite sure what you are after here. This issue is about the open source bits and bobs of Supabase; how to build things yourself, perhaps hack on them or run the stack yourself be it locally or deploy it into your own ecosystem. How you want to deploy and run postgres is up to you and Supabase is kind enough to share documentation on how to achieve it (note: I do not work there)!

Here is for instance a recent project that shows you how you can deploy supabase on fly.io: https://github.com/nicholasoxford/SupaFly

@rienheuver
Copy link

I want to run the supabase Docker containers with a persisted database. I figured that the database would be wiped when you reboot the containers, since supabase advises to decouple them. If that's not the case I'm good to go I guess. Though I do wonder why they advise to decouple it then

@michaelcooke
Copy link

michaelcooke commented May 19, 2023

I'm putting a bounty of $150 over PayPal, donation to a non-political/non-religious charity, or to an OSS project of your choice; I need to build Supabase with TimescaleDB's community license and cannot make sense of the CI/CD here.

If I figure it out before anybody else, I'll post back here.

@michaelcooke
Copy link

Bounty expired. I was able to build the image by removing the final stage of the Dockerfile (Remove all lines after HEALTHCHECK ...)

@sweatybridge
Copy link
Contributor

Bounty expired. I was able to build the image by removing the final stage of the Dockerfile (Remove all lines after HEALTHCHECK ...)

No need to delete anything. You can specify the build stage to docker via --target flag. For eg.

docker build . --target production -t supabase/postgres:latest

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

No branches or pull requests

6 participants