~ knotless Search/
↑↓ move↵ open⇧↵ all results
0
0

A container image for the server, and how to deploy it

Merged
Merged chadtmiller.com asked to merge into main from chadtmiller.com/monolith:deploy/container

A Dockerfile for the server, and a README section on deploying it: the variables a server on the network needs, and what the reverse proxy in front of it does. No change to what the server does.

Claude Opus 5.5 · high

What changes

Dockerfile. Three stages:

  1. The pages, with npm ci and vite build on Node 24.22.1.
  2. cargo build --release --locked -p pds on rust:1.98-trixie, the gates' toolchain, with web/dist from the first stage.
  3. The binary alone on debian:trixie-slim, run as the user pds (uid 10001), with PDS_PORT=2583, PDS_BIND_ADDRESS=:: and PDS_DATA_DIR=/data, a volume. The entrypoint is pds and the command serve, so docker run … spec-pds repo list-records … is the CLI.

.dockerignore keeps target, node_modules, the harness, bench, compat and .git out of the context.

README. A "Deploying" section: build and run the image, and how a server sits behind a proxy. It takes in the PDS_TRUSTED_PROXIES paragraph from "Running it". It has a table of the variables a server on the network is given, with production values: https://plc.directory, the Bluesky AppView and CDN, https://bsky.network, a rotation key from openssl rand -hex 32 kept in a secret store, and a recovery key held offline. It names the three development-only variables never to set there.

Why

Nothing in the repository built something deployable: the server was a binary to build by hand. :: is the image's default because on Linux it takes IPv4 too, and it is the only address a network of IPv6 alone, such as Railway's private network, reaches.

How it was checked

docker build builds it; the binary's stage took 1m 36s here. Run with a named volume and the port published:

  • _health and describeServer answer from the host, so :: takes the IPv4 the port is forwarded to.
  • It runs as uid=10001(pds), with /data at 0700 and its files at 0600.
  • docker stop takes 0.3 s and exits 0, its log ending with shutdown.
  • Started again on the volume, it serves, with no recovered line.
  • PDS_BIND_ADDRESS=localhost exits 1 with why on standard error.

No gate covers these files, so the gates workflow files the pull as skipped.

Shortcomings

  • No gate builds the image, so a change to the build (a new file a build.rs reads, a new toolchain) can break it unnoticed until someone builds it.
  • /metrics is on the container's loopback, so it cannot be scraped from outside it (spec/OPERATIONS.md).
Approved

This adds a three-stage Dockerfile, a .dockerignore and a README "Deploying" section. It also moves the reverse-proxy paragraph there from "Running it". No server behaviour changes, so nothing is owed to spec/, and the README describes what is built, not how. The image copies Cargo.toml, Cargo.lock, .cargo, crates, spec and web/dist. That covers what I found the build reading outside crates/: spec/lexicons and spec/data for build.rs and include_str!, and web/dist for pds-server's build.rs. The spec/interop fixtures read by tests are in spec too. The env var names I spot-checked in spec/ (PDS_CRAWLERS, PDS_RECOVERY_DID_KEY) exist. There are no harness or conformance.yaml changes and no new crates. I did not build the image; I'm relying on the author's account of it. The residual risk is the one the author names: no gate builds the image.

Approved

This is still the Dockerfile, .dockerignore and README "Deploying" section I approved, with no change to server behaviour. Since then the pull has been rebased onto a base that now holds the PDS_BIND_ADDRESS change. That change brings spec/PDS.md, spec/OPERATIONS.md, the harness listener checks and the code, and it is not part of this pull. pull_diff shows only the image files and the README. The harness checks are new and stricter, and conformance.yaml is untouched. The README no longer repeats the bind-address sentence that the base already moved. Its "Deploying" section now says that outside a container the default is 127.0.0.1, and that the image sets ::. That matches spec/PDS.md. I did not build the image. The risk the author names stands: no gate builds the image.

Merged as 7b8cdd5