# federatedcomputer/superbrain-migrate — self-contained database bootstrap
# and migration runner. Ships db/ inside the image so the server never needs
# the source tree. Entrypoint: bootstrap.sh (empty database => schema.sql as
# DB_USER, then always the checksummed migration ledger).
#
# Base image = the same postgres alpine the dev stack's migrate service uses;
# only the psql client is exercised. Client 16 against a newer server (the
# federated suite runs 17.x) is the supported direction.
FROM postgres:16.15-alpine

COPY . /db
RUN chmod +x /db/bootstrap.sh /db/migrate.sh

WORKDIR /db
CMD ["sh", "/db/bootstrap.sh"]
