Files
infrastructure/gdo/Dockerfile
T
blandClaude 1f37681696 The stack for portal 1.0: a store of its own, gdo and kron dialling the site
Portal 1.0 keeps everything in one file (portal_data) and has no NATS.
gdo and kron dial it over dhd/1 from loopback, so the three share one
network namespace, held by a container of its own: held by portal, a
restart of portal cut the other two off. NATS stays behind a profile
nothing turns on, for going back; the chat (cnats) is out.

The deploy writes DHD_KEYS and the hash of LOAD_TOKEN, and no NATS or
chat settings. gdo is built from uhhm/gdo at GDO_RELEASE, since the gdo
that dials a site is not in the registry. move.sh reads the programs'
keys and prints what the deploy wants.

Run on kasse beside the live stack, on other ports, with made-up
records: mail out, a payment settled, content loaded over /dhd/1/load,
and both programs back after portal was restarted and made anew.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L5fbDjTQg4CJsNqEo7hhE7
2026-11-24 12:40:41 +01:00

43 lines
1.8 KiB
Docker

# gdo, the mailer, built from uhhm/gdo at GDO_RELEASE: a tag, or a commit.
#
# Built here rather than installed from the [uhhm] Arch registry, as it
# was while the site ran portal 0.19: the gdo that dials a portal 1.0
# site (0.4, which reads no NATS) is not in the registry yet, and is
# held back from it on purpose. A host that upgraded to it while it
# still has a 0.x site would stop sending that site's mail. Once 0.4 is
# published, this can install the package again (uhhm-registry.asc
# beside this file is the registry's key, kept for then).
#
# Arch for both stages, because that is what every uhhm binary is built
# on and run on: the runtime's glibc is then never older than the
# builder's.
FROM archlinux:base AS build
ARG GDO_RELEASE
# -Syu, never -Sy: a partial upgrade pulls a library newer than what the
# base image's own pacman was built against and refuses to install.
RUN pacman -Syu --noconfirm --needed git rust gcc \
&& pacman -Scc --noconfirm
WORKDIR /src
# The ref by name, so a tag and a commit both do; --locked, so the build
# is the one the repo's own lock file describes.
RUN test -n "$GDO_RELEASE" \
&& git init -q . \
&& git fetch -q --depth 1 https://project.uhhm.no/uhhm/gdo.git "$GDO_RELEASE" \
&& git checkout -q FETCH_HEAD \
&& cargo build --release --locked \
&& install -Dm755 target/release/gdo /out/gdo
FROM archlinux:base
RUN pacman -Syu --noconfirm --needed ca-certificates \
&& pacman -Scc --noconfirm \
&& rm -rf /var/cache/pacman/pkg/* /var/lib/pacman/sync/*
COPY --from=build /out/gdo /usr/bin/gdo
# A non-root user. gdo keeps its key on dhd/1 in /var/lib/gdo, a volume
# (GDO_KEY in compose.yml); what it has not yet delivered waits with the
# site, not here.
RUN useradd --system --no-create-home gdo \
&& mkdir -p /var/lib/gdo && chown gdo /var/lib/gdo && chmod 700 /var/lib/gdo
USER gdo
CMD ["/usr/bin/gdo"]