mirror of
https://github.com/napnap75/multiarch-docker-images.git
synced 2026-11-12 00:52:11 +01:00
archivist: migrate to PocketBase v0.41.1 (module ganigeorgiev.com/pocketbase/pocketbase); dbx moved to ganigeorgiev.com/pocketbase/dbx; go 1.27 and golang:1.27-alpine builder
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
# the runtime is scratch with only that binary and the files it needs.
|
# the runtime is scratch with only that binary and the files it needs.
|
||||||
|
|
||||||
# --- build stage ------------------------------------------------------------
|
# --- build stage ------------------------------------------------------------
|
||||||
FROM golang:1.23-alpine AS build
|
FROM golang:1.27-alpine AS build
|
||||||
WORKDIR /src
|
WORKDIR /src
|
||||||
|
|
||||||
# ca-certificates and tzdata are copied into the runtime image below.
|
# ca-certificates and tzdata are copied into the runtime image below.
|
||||||
|
|||||||
+2
-2
@@ -16,7 +16,7 @@ Everything runs offline on the server infrastructure: no cloud APIs, no outbound
|
|||||||
|
|
||||||
| Component | Choice |
|
| Component | Choice |
|
||||||
|---|---|
|
|---|---|
|
||||||
| Framework / runtime | PocketBase (Go framework, single binary) |
|
| Framework / runtime | PocketBase v0.41.1 (Go framework, single binary; module `ganigeorgiev.com/pocketbase/pocketbase`) |
|
||||||
| Language | Go |
|
| Language | Go |
|
||||||
| Scheduling | `app.Cron()` (S3 poller, periodic tasks) |
|
| Scheduling | `app.Cron()` (S3 poller, periodic tasks) |
|
||||||
| S3 | MinIO Go SDK (`github.com/minio/minio-go/v7`) |
|
| S3 | MinIO Go SDK (`github.com/minio/minio-go/v7`) |
|
||||||
@@ -261,7 +261,7 @@ The gate is a regression detector for dependency upgrades (PocketBase, minio-go,
|
|||||||
|
|
||||||
`Dockerfile`, two-stage build:
|
`Dockerfile`, two-stage build:
|
||||||
|
|
||||||
- Builder: `golang:1.23-alpine`, CGO disabled, static binary, `TARGETARCH` honored for multi-platform builds under buildx. `go mod tidy` runs there because `go.sum` is not committed; once it is committed, the line becomes `go mod download` for fully reproducible builds.
|
- Builder: `golang:1.27-alpine` (matches the `go 1.27` directive of PocketBase v0.41.1), CGO disabled, static binary, `TARGETARCH` honored for multi-platform builds under buildx. `go mod tidy` runs there because `go.sum` is not committed; once it is committed, the line becomes `go mod download` for fully reproducible builds.
|
||||||
- Runtime: `scratch` with only the `/archivist` binary, the CA bundle (the S3 endpoint is HTTPS by default), the timezone database (the cron and date rendering honor `TZ`), and `/app/pb_data` + `/tmp`, the only writable directories, owned by the unprivileged runtime user 65532. `config.jsonc` is never baked in: it is mounted at runtime, `ARCHIVIST_CONFIG` defaulting to `config.jsonc` relative to `/app`.
|
- Runtime: `scratch` with only the `/archivist` binary, the CA bundle (the S3 endpoint is HTTPS by default), the timezone database (the cron and date rendering honor `TZ`), and `/app/pb_data` + `/tmp`, the only writable directories, owned by the unprivileged runtime user 65532. `config.jsonc` is never baked in: it is mounted at runtime, `ARCHIVIST_CONFIG` defaulting to `config.jsonc` relative to `/app`.
|
||||||
|
|
||||||
The container runs as 65532:65532 (non-root), exposes 8090, declares `/app/pb_data` as a volume, and has no shell: `docker exec` is not available. `.dockerignore` keeps the build context to the Go sources; the E2E harness is not part of the image.
|
The container runs as 65532:65532 (non-root), exposes 8090, declares `/app/pb_data` as a volume, and has no shell: `docker exec` is not available. `.dockerignore` keeps the build context to the Go sources; the E2E harness is not part of the image.
|
||||||
|
|||||||
+3
-2
@@ -1,12 +1,13 @@
|
|||||||
module github.com/napnap75/archivist
|
module github.com/napnap75/archivist
|
||||||
|
|
||||||
go 1.23
|
go 1.27
|
||||||
|
|
||||||
// Run `go mod tidy` to resolve the exact compatible versions.
|
// Run `go mod tidy` to resolve the exact compatible versions.
|
||||||
require (
|
require (
|
||||||
|
ganigeorgiev.com/pocketbase/dbx v1.13.0
|
||||||
|
ganigeorgiev.com/pocketbase/pocketbase v0.41.1
|
||||||
github.com/expr-lang/expr v1.17.6
|
github.com/expr-lang/expr v1.17.6
|
||||||
github.com/ledongthuc/pdf v0.0.0-20240201144150-fd9d85c880aa
|
github.com/ledongthuc/pdf v0.0.0-20240201144150-fd9d85c880aa
|
||||||
github.com/minio/minio-go/v7 v7.0.88
|
github.com/minio/minio-go/v7 v7.0.88
|
||||||
github.com/pocketbase/pocketbase v0.26.6
|
|
||||||
github.com/tailscale/hujson v0.4.0
|
github.com/tailscale/hujson v0.4.0
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -5,9 +5,9 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
ganigeorgiev.com/pocketbase/pocketbase/core"
|
||||||
"github.com/napnap75/archivist/internal/config"
|
"github.com/napnap75/archivist/internal/config"
|
||||||
"github.com/napnap75/archivist/internal/storage"
|
"github.com/napnap75/archivist/internal/storage"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// BindHooks registers the request hooks (US-04, US-22, US-23).
|
// BindHooks registers the request hooks (US-04, US-22, US-23).
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import (
|
|||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
|
ganigeorgiev.com/pocketbase/pocketbase/core"
|
||||||
"github.com/napnap75/archivist/internal/config"
|
"github.com/napnap75/archivist/internal/config"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const eventsName = "document_events"
|
const eventsName = "document_events"
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
ganigeorgiev.com/pocketbase/dbx"
|
||||||
|
ganigeorgiev.com/pocketbase/pocketbase/core"
|
||||||
"github.com/ledongthuc/pdf"
|
"github.com/ledongthuc/pdf"
|
||||||
"github.com/napnap75/archivist/internal/config"
|
"github.com/napnap75/archivist/internal/config"
|
||||||
"github.com/napnap75/archivist/internal/pbapp"
|
"github.com/napnap75/archivist/internal/pbapp"
|
||||||
"github.com/napnap75/archivist/internal/storage"
|
"github.com/napnap75/archivist/internal/storage"
|
||||||
"github.com/pocketbase/pocketbase/core"
|
|
||||||
"github.com/pocketbase/pocketbase/tools/dbx"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// pollState remembers size and ETag between two passes (US-10 write-completion wait).
|
// pollState remembers size and ETag between two passes (US-10 write-completion wait).
|
||||||
|
|||||||
+2
-2
@@ -4,12 +4,12 @@ import (
|
|||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
|
ganigeorgiev.com/pocketbase/pocketbase"
|
||||||
|
ganigeorgiev.com/pocketbase/pocketbase/core"
|
||||||
"github.com/napnap75/archivist/internal/config"
|
"github.com/napnap75/archivist/internal/config"
|
||||||
"github.com/napnap75/archivist/internal/pbapp"
|
"github.com/napnap75/archivist/internal/pbapp"
|
||||||
"github.com/napnap75/archivist/internal/pipeline"
|
"github.com/napnap75/archivist/internal/pipeline"
|
||||||
"github.com/napnap75/archivist/internal/storage"
|
"github.com/napnap75/archivist/internal/storage"
|
||||||
"github.com/pocketbase/pocketbase"
|
|
||||||
"github.com/pocketbase/pocketbase/core"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// EnvConfig is the technical configuration, from environment variables (US-01).
|
// EnvConfig is the technical configuration, from environment variables (US-01).
|
||||||
|
|||||||
Reference in New Issue
Block a user