build(sidecar): containerize + delete the Node prototype
- New sidecar/Dockerfile: multi-stage golang:1.25-alpine → distroless/ static, ~12 MB final image, static CGO-free binary. - Wire pp-sidecar into docker-compose.photoprism.yml so the whole stack (mariadb + photoprism + sidecar) starts with one `podman-compose up`. Container reaches mariadb + photoprism on the internal network; the host gets 127.0.0.1:8000 for Vite's proxy. - New SIDECAR_LISTEN_ADDR env var (default 127.0.0.1 for the host-mode dev loop) so the container can bind 0.0.0.0:8000 and let the port mapping reach it. Without this the loopback bind was invisible to the host. - Delete sidecar/legacy/server.mjs — the Node prototype's archival window is over; git history is its home now. - Update sidecar/README with compose-first bringup; keep the host `go build` flow as the fast-iteration loop. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -12,7 +12,8 @@ import (
|
||||
type Config struct {
|
||||
OriginalsRoot string // absolute path to PhotoPrism's originals dir
|
||||
PhotoprismBaseURL string // e.g. http://localhost:2342
|
||||
Port int // HTTP listen port (loopback only)
|
||||
ListenAddr string // bind interface — 127.0.0.1 for host mode, 0.0.0.0 in containers
|
||||
Port int // HTTP listen port
|
||||
DSN string // GORM/MySQL connection string for mule_sidecar
|
||||
}
|
||||
|
||||
@@ -47,6 +48,7 @@ func loadConfig() (*Config, error) {
|
||||
return &Config{
|
||||
OriginalsRoot: abs,
|
||||
PhotoprismBaseURL: envOr("PHOTOPRISM_BASE_URL", "http://localhost:2342"),
|
||||
ListenAddr: envOr("SIDECAR_LISTEN_ADDR", "127.0.0.1"),
|
||||
Port: port,
|
||||
DSN: dsn,
|
||||
}, nil
|
||||
|
||||
Reference in New Issue
Block a user