fabro/Dockerfile
Bryan Helmkamp 719fa32cf3
Some checks failed
Rust / Clippy (push) Waiting to run
Rust / Test (macOS) (push) Waiting to run
Rust / Process titles (musl) (push) Waiting to run
Rust / Format (push) Waiting to run
Rust / Rustdoc (push) Waiting to run
Rust / Generated Docs (push) Waiting to run
Rust / Test (Linux) (push) Waiting to run
Rust / Sandbox providers (Docker) (push) Waiting to run
Installer / Homebrew push retries (push) Has been cancelled
Ship third-party notices in release archives and the Docker image
Release archives now carry LICENSE.md and THIRD_PARTY_NOTICES.txt next
to the binary, inside the existing fabro-<target>/ directory. The path
of the binary does not change, so install.sh, `fabro upgrade`, and the
Homebrew formulas continue to work.

The Docker image copies both files to /usr/share/doc/fabro/. The
release smoke test now fails if either file is missing or unreadable.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-12 12:13:11 -05:00

47 lines
1.6 KiB
Docker

# syntax=docker/dockerfile:1.9
#
# Runtime image for the Fabro server.
#
# Binaries are supplied pre-built via the release workflow:
# tmp/docker-context/amd64/fabro (x86_64-unknown-linux-musl)
# tmp/docker-context/arm64/fabro (aarch64-unknown-linux-musl)
#
# The image serves the HTTP API (with embedded web UI) on $PORT (default
# 32276), persists state to /storage, and runs as the unprivileged `fabro`
# user. Honoring $PORT lets PaaS providers (Railway, Fly, Render, Heroku,
# Cloud Run) route traffic without extra configuration.
FROM ghcr.io/fabro-sh/dhi-alpine-base:3.23-dev-2026-04-18
USER root
ARG TARGETARCH
RUN apk add --no-cache \
ca-certificates \
git \
su-exec \
tini \
&& addgroup -S -g 1000 fabro \
&& adduser -S -u 1000 -G fabro -h /var/fabro -s /sbin/nologin fabro \
&& install -d -o fabro -g fabro -m 0755 /var/fabro /storage \
&& install -d -m 0755 /usr/share/doc/fabro
COPY --chmod=0755 tmp/docker-context/${TARGETARCH}/fabro /usr/local/bin/fabro
COPY --chmod=0755 docker/entrypoint.sh /usr/local/bin/fabro-entrypoint
# License and third-party notices must accompany every distributed copy.
# The directory is created above: `COPY --chmod` would also apply 0644 to a
# directory it creates, which makes the files unreadable for the fabro user.
COPY --chmod=0644 LICENSE.md THIRD_PARTY_NOTICES.txt /usr/share/doc/fabro/
ENV FABRO_HOME=/storage/.home \
FABRO_STORAGE_DIR=/storage \
FABRO_LOG_DESTINATION=stdout
VOLUME ["/storage"]
EXPOSE 32276
ENTRYPOINT ["/sbin/tini", "--", "/usr/local/bin/fabro-entrypoint"]
CMD ["sh", "-c", "exec fabro server start --foreground --bind 0.0.0.0:${PORT:-32276}"]