Adding Supabase
Supabase includes a lot of services so it can sometimes timeout pulling the images. It would be a good idea to pull all required images beforehand using the command below:
docker pull supabase/studio:20221214-4eecc99
docker pull kong:2.8.1
docker pull supabase/gotrue:v2.40.1
docker pull postgrest/postgrest:v9.0.1.20220717
docker pull supabase/realtime:v2.0.2
docker pull supabase/storage-api:v0.26.1
docker pull supabase/postgres-meta:v0.52.1
docker pull supabase/postgres:14.1.0.89
To test the deployment copy the template from here and paste in Caprover -> One Click Apps -> template
☑️ Self Check before Merge
- [ ] I have tested the template using the method described in README.md thoroughly
- [X] I have ensured that I put as much default values as possible (except passwords) to ensure minimum effort required for end users to get started.
- [X] I have ensured that I am not using the "latest" tag as this tag is dynamically changing and might break the one-click app. Use a fixed version.
- [X] I have made sure that instructions.start and instructions.end are clear and self-explanatory.
- [X] Icon is added as a png file to the logos directory.
@ak4zh thanks for this PR, for the section that has your // TODO comment, this is what you need to do:
$$cap_appname-realtime: depends_on: - $$cap_appname-db restart: unless-stopped environment: PORT: 4000 DB_HOST: srv-captain--$$cap_appname-db DB_PORT: 5432 DB_USER: $$cap_pg_user DB_PASSWORD: $$cap_pg_pass DB_NAME: $$cap_pg_db DB_AFTER_CONNECT_QUERY: 'SET search_path TO _realtime' DB_ENC_KEY: supabaserealtime API_JWT_SECRET: $$cap_jwt_secret FLY_ALLOC_ID: fly123 FLY_APP_NAME: realtime SECRET_KEY_BASE: UpNVntn3cDxHJpq99YMc1T1AQgQpc8kfYTuRgBiYa15BLrx8etQoXz3gZv1/u2oq ERL_AFLAGS: -proto_dist inet_tcp ENABLE_TAILSCALE: "false" DNS_NODES: "''" caproverExtra: containerHttpPort: 4000 dockerfileLines: - FROM supabase/realtime:$$cap_realtime_version - CMD sh -c "/app/bin/migrate && /app/bin/realtime eval 'Realtime.Release.seeds(Realtime.Repo)' && /app/bin/server"
It'd be great if you update this PR. Thanks!
Thanks, @pedropaf I have updated the PR. Have you tested the deployment? The above app deploys for me but I am having some issues connecting the dashboard with the API. Hoping someone can figure that out.
Just tested this out, but there is an issue with line: 413
The image /var/lib/docker/volumes/captain--supabase-db-init/_data/ does not exist.
Should it be db instead of init ?
@HarunKilic Just checked with supabase official docker file. Seems line 413 is not required anymore as the example data.sql on supabase repo is empty anyway.
You may need to copy the SQL files from their repo and to appropriate volumes. I will update the instructions later.
@ak4zh do you have a running instance running right now?
The configurations does almost work.
But I get an infinite Connecting to Default Project message on the frontend.
The log says error - Failed to load env from /app/studio/.env RangeError: Maximum call stack size exceeded
@HarunKilic I do not have a running instance with me right now because supabase is quite big and crashes on playwithdocker. I was testing on my production server but don't want to mess it up.
While I was testing I got the same issue studio is not able to connect to the pgrest API. I will try to do some more tests on a new DO instance.
@ak4zh I just tried to deploy it again, and I have issues with the DB.
initdb: error: directory "/var/lib/postgresql/data" exists but is not empty
2023-03-16T11:54:07.364660625Z initdb: hint: If you want to create a new database system, either remove or empty the directory "/var/lib/postgresql/data" or run initdb with an argument other than "/var/lib/postgresql/data".
This happens when following step 4.
Hi!
Did you find the reason for the problem with db? Do you need any help with investigation?
@ak4zh I just tried to deploy it again, and I have issues with the DB.
initdb: error: directory "/var/lib/postgresql/data" exists but is not empty 2023-03-16T11:54:07.364660625Z initdb: hint: If you want to create a new database system, either remove or empty the directory "/var/lib/postgresql/data" or run initdb with an argument other than "/var/lib/postgresql/data".This happens when following step 4.
Same thing happened with me
@AriaFantom There are multiple commands in step 4. Which exact command causes the issue? The first command is to delete the existing data folder so after that it should not say db exists.
I have stopped using supabase and moved all my projects to use drizzle ORM instead. As supabase self hosting is overly complicated for me and the hosted solution get’s super expensive over time. I would still be interested in getting it added on caprover so if anyone can get it working that would be amazing. At the moment everything deploys smooth for me but I have some issues connecting them together.
@AriaFantom There are multiple commands in step 4. Which exact command causes the issue? The first command is to delete the existing data folder so after that it should not say db exists.
I have stopped using supabase and moved all my projects to use drizzle ORM instead. As supabase self hosting is overly complicated for me and the hosted solution get’s super expensive over time. I would still be interested in getting it added on caprover so if anyone can get it working that would be amazing. At the moment everything deploys smooth for me but I have some issues connecting them together.
After stopping the instance of pg then it doesn't starts