chadtmiller.com/monolith
An atproto PDS
0
0
# The server as a container image: `pds serve`, listening on every address
# of the container's network, its data on the volume /data, run as a user
# of its own. The rest of its environment is the operator's
# (docs/guide/deploying.md).
#
# docker build -t monolith .
# docker run -p 2583:2583 -v pds-data:/data --env-file pds.env monolith
#
# The image is the `pds` binary alone: `pds <group> <command>` in it is the
# CLI, as anywhere.
# The authorization pages, which pds-server embeds as it compiles.
FROM node:24.22.1-trixie-slim AS web
WORKDIR /src/web
COPY web/package.json web/package-lock.json ./
RUN npm ci --no-audit --no-fund
COPY web/ ./
RUN npm run build
# The toolchain the gates build with (.knotless/workflows/gates.yml).
FROM rust:1.98-trixie AS build
WORKDIR /src
COPY Cargo.toml Cargo.lock ./
COPY .cargo .cargo
COPY crates crates
COPY spec spec
COPY --from=web /src/web/dist web/dist
RUN cargo build --release --locked -p pds
# The released image is this stage made with no container engine
# (.knotless/image.sh, release.yml): keep the two alike.
FROM debian:trixie-slim
RUN groupadd --system --gid 10001 pds \
&& useradd --system --uid 10001 --gid 10001 --home-dir /data --shell /usr/sbin/nologin pds \
&& mkdir /data && chown pds:pds /data
COPY --from=build /src/target/release/pds /usr/local/bin/pds
COPY LICENSE-APACHE LICENSE-MIT /usr/share/doc/monolith/
LABEL org.opencontainers.image.licenses="MIT OR Apache-2.0"
USER pds
# `::` takes IPv4 too on Linux, and is the address a network of IPv6 alone
# (as Railway's private one) reaches; `0.0.0.0` where the kernel has no IPv6.
ENV PDS_PORT=2583 PDS_BIND_ADDRESS=:: PDS_DATA_DIR=/data
VOLUME /data
EXPOSE 2583
ENTRYPOINT ["pds"]
CMD ["serve"]