fix: pocketbase healthcheck (add wget) + saveIfAbsent infinite recursion
Some checks failed
Release / Test backend (push) Successful in 1m6s
Release / Check ui (push) Successful in 1m56s
Release / Docker (push) Successful in 8m19s
Release / Deploy to prod (push) Failing after 36s
Release / Gitea Release (push) Successful in 22s

- Add wget to pocketbase Alpine image so the docker-compose healthcheck
  (wget http://localhost:8090/api/health) can actually run
- Fix saveIfAbsent calling itself instead of app.Save(c) — was an
  infinite recursion that would stack-overflow on a fresh install

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Admin
2026-04-15 18:05:02 +05:00
parent 812028e50d
commit 3f436877ee
2 changed files with 2 additions and 2 deletions

View File

@@ -48,7 +48,7 @@ ENTRYPOINT ["/backend"]
# On every `serve` startup it applies any pending migrations automatically.
# Data is stored in /pb_data (mounted as a Docker volume in production).
FROM alpine:3.21 AS pocketbase
RUN apk add --no-cache ca-certificates && \
RUN apk add --no-cache ca-certificates wget && \
addgroup -S appgroup && adduser -S appuser -G appgroup
COPY --from=builder /out/pocketbase /pocketbase
RUN mkdir -p /pb_data && chown appuser:appgroup /pb_data

View File

@@ -81,7 +81,7 @@ func saveIfAbsent(app core.App, c *core.Collection) error {
if _, err := app.FindCollectionByNameOrId(c.Name); err == nil {
return nil // already exists — skip
}
return saveIfAbsent(app, c)
return app.Save(c)
}
// ── Collection creators ───────────────────────────────────────────────────────