# Author: Simon-Pierre Boucher # Mail: contact@spboucher.ai # Stablecoin explorer stack. # # cp .env.example .env # then: docker compose up -d # # Storage today is SQLite on the shared `data` volume (indexer writes, API # reads — WAL mode makes that safe). The postgres service is provisioned now # so Deliverable 5 (PostgreSQL schema + migrations) is a config switch, not # an infra change. services: postgres: image: postgres:16-alpine environment: POSTGRES_USER: ${POSTGRES_USER:-explorer} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-explorer} POSTGRES_DB: ${POSTGRES_DB:-explorer} volumes: - pgdata:/var/lib/postgresql/data ports: - "127.0.0.1:${POSTGRES_PORT:-5433}:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-explorer}"] interval: 10s timeout: 5s retries: 5 indexer: build: . command: python run_indexer.py environment: EXPLORER_DB: /data/explorer.db EXPLORER_CHAINS: ${EXPLORER_CHAINS:-} EXPLORER_BACKFILL_DAYS: ${EXPLORER_BACKFILL_DAYS:-0} # set DATABASE_URL to use postgres instead of the SQLite volume DATABASE_URL: ${DATABASE_URL:-} volumes: - data:/data depends_on: postgres: condition: service_healthy restart: unless-stopped api: build: . command: uvicorn api.main:app --host 0.0.0.0 --port 8080 environment: EXPLORER_DB: /data/explorer.db DATABASE_URL: ${DATABASE_URL:-} volumes: - data:/data ports: - "${API_PORT:-8080}:8080" depends_on: - indexer restart: unless-stopped volumes: data: pgdata: