fix: pocketbase healthcheck (add wget) + saveIfAbsent infinite recursion
- 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:
@@ -48,7 +48,7 @@ ENTRYPOINT ["/backend"]
|
|||||||
# On every `serve` startup it applies any pending migrations automatically.
|
# On every `serve` startup it applies any pending migrations automatically.
|
||||||
# Data is stored in /pb_data (mounted as a Docker volume in production).
|
# Data is stored in /pb_data (mounted as a Docker volume in production).
|
||||||
FROM alpine:3.21 AS pocketbase
|
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
|
addgroup -S appgroup && adduser -S appuser -G appgroup
|
||||||
COPY --from=builder /out/pocketbase /pocketbase
|
COPY --from=builder /out/pocketbase /pocketbase
|
||||||
RUN mkdir -p /pb_data && chown appuser:appgroup /pb_data
|
RUN mkdir -p /pb_data && chown appuser:appgroup /pb_data
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ func saveIfAbsent(app core.App, c *core.Collection) error {
|
|||||||
if _, err := app.FindCollectionByNameOrId(c.Name); err == nil {
|
if _, err := app.FindCollectionByNameOrId(c.Name); err == nil {
|
||||||
return nil // already exists — skip
|
return nil // already exists — skip
|
||||||
}
|
}
|
||||||
return saveIfAbsent(app, c)
|
return app.Save(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
// ── Collection creators ───────────────────────────────────────────────────────
|
// ── Collection creators ───────────────────────────────────────────────────────
|
||||||
|
|||||||
Reference in New Issue
Block a user