rodydavis / pocketbase-cloudrun

Run PocketBase on CloudRun with mounted volumes via Google Cloud Storage
Apache License 2.0
19 stars 8 forks source link

pb_public, pb_hooks, and pb_migrations not copying to cloud storage #1

Open tewshi opened 5 days ago

tewshi commented 5 days ago

After applying the changes as suggested, I deployed successfully, but noticed that the pb_hooks, pb_public and pb_migrations directories are not saved on cloud storage.

The pb_data directory copies, which I believe it does so because it is generated at run time and not at build time.

when I run the docker build locally, I can see the /cloud/storage folder in the files of the image (which is expected since I'm not mounting any cloud directory in my local machine), but I expect this /cloud/storage to be mapped (at docker build time) to the actual mounted directory pointing to Google cloud storage

rodydavis commented 5 days ago

That is correct!

https://github.com/rodydavis/pocketbase-cloudrun/blob/main/Dockerfile#L27

You need to upload the files for pb_public and pb_hooks directly to cloud storage in the same location beside pb_data. It is already mapped but pb_data is created the first time it is run

tewshi commented 5 days ago

wish there's a way to handle this, wanted to. use gcloud storage cp but that will require authentication in the docker image... also tried docker --mount option, mount only works when running the image, not when building.

there has to be an easier way to get it done...

rodydavis commented 5 days ago

Well as per the command you can customize the paths.

If you want them to be local to the container, just modify the Dockerfile to change where they point to.

Then you would just copy the files in on docker build.