gitmote

gitmote / docker-compose.yml  ·  history  ·  branches

1739 bytes · raw

# Local self-hosting stack: MinIO (object store) + gitmote (single writer).
# Driven by `make e2e-local` (scripts/e2e-local.sh). A bucket alone derives the
# metadata replica and single-writer lease, so refs survive both a restart (via
# the gitmote-data volume) and a full wipe (restored from S3 — see e2e-restore).
name: gitmote-e2e

services:
  minio:
    image: minio/minio
    command: server /data --console-address :9001
    environment:
      MINIO_ROOT_USER: minioadmin
      MINIO_ROOT_PASSWORD: minioadmin
    # No host port: only the compose network (gitmote, mc) reaches MinIO, so we
    # avoid colliding with anything already bound to :9000 on the host.
    volumes:
      - minio-data:/data

  # One-shot bucket creation; not started by `up` (setup profile), invoked with
  # `docker compose run --rm mc`. MC_HOST_local configures the alias via env, so
  # no interactive `mc alias set` is needed; it retries until MinIO is reachable.
  mc:
    image: minio/mc
    profiles: ["setup"]
    depends_on: [minio]
    environment:
      MC_HOST_local: http://minioadmin:minioadmin@minio:9000
    entrypoint: ["/bin/sh", "-c"]
    command:
      - "until mc ls local >/dev/null 2>&1; do echo 'waiting for minio'; sleep 1; done; mc mb --ignore-existing local/gitmote"

  gitmote:
    build:
      context: .
    image: gitmote:e2e
    depends_on: [minio]
    environment:
      GITMOTE_S3_BUCKET: gitmote        # storage root; derives the replica (s3://gitmote/meta)
      GITMOTE_S3_ENDPOINT: http://minio:9000
      AWS_REGION: us-east-1
      AWS_ACCESS_KEY_ID: minioadmin
      AWS_SECRET_ACCESS_KEY: minioadmin
    ports:
      - "8080:8080"
    volumes:
      - gitmote-data:/data

volumes:
  minio-data:
  gitmote-data: