Using WAL‑G in Docker with Supabase
Hi Community,
I’m trying to integrate WAL‑G into my self‑hosted Supabase Docker setup to back up the Postgres database continuously to S3. The storage files are saved in Supabase and synced to S3 via rclone. If everything is configured manually, the setup works fine.
However, the issue arises when rebuilding the environment: setting archive_mode = yes during the initial startup causes Postgres to immediately attempt WAL‑G with S3, which blocks the startup. It seems WAL‑G’s archive command is triggered too early before the database is ready.
My questions:
Thanks in advance for any guidance!
I’m trying to integrate WAL‑G into my self‑hosted Supabase Docker setup to back up the Postgres database continuously to S3. The storage files are saved in Supabase and synced to S3 via rclone. If everything is configured manually, the setup works fine.
However, the issue arises when rebuilding the environment: setting archive_mode = yes during the initial startup causes Postgres to immediately attempt WAL‑G with S3, which blocks the startup. It seems WAL‑G’s archive command is triggered too early before the database is ready.
My questions:
- Is it possible—and recommended—to run WAL‑G inside the Postgres container with an entrypoint script?
- If yes, what’s the correct sequence? Should WAL‑G be initialized only after the Postgres server is fully up?
- Has anyone already solved this in a Docker + Supabase setup? Useful if you can share:
• Custom entrypoint scripts
• Dockerfile examples
• Best practice patterns
Thanks in advance for any guidance!