From 4886854cda4034b87e15d37bf2cbf0e5a81adec5 Mon Sep 17 00:00:00 2001 From: Tony Grosinger Date: Sun, 24 Jul 2022 09:04:15 -0700 Subject: [PATCH] Add metabase and improve configuration --- .env | 30 +++++++++++++++++++++++++++--- .gitignore | 2 ++ config/.gitinclude | 0 docker-compose.yaml | 18 +++++++++++++++++- 4 files changed, 46 insertions(+), 4 deletions(-) create mode 100644 config/.gitinclude diff --git a/.env b/.env index 17c01c2..cec0403 100644 --- a/.env +++ b/.env @@ -1,7 +1,31 @@ -# The parent folder containing your ledger files +# The parent folder containing configuration data for the various apps. +CONFIG_DIR=config + +# The parent folder containing your ledger files. LEDGER_DIR=data -# The name of your primary ledger file + +# The name of your primary ledger file (within the LEDGER_DIR). PRIMARY_LEDGER_FILE=all.ledger +## +## HLedger +## + HLEDGER_PORT=5000 -HLEDGER_BASE_URL=http://localhost:5000 \ No newline at end of file +HLEDGER_BASE_URL=http://localhost:5000 + +## +## SQLite Conversion +## + +# Will be placed in the LEDGER_DIR and made available to Metabase. +SQLITE_OUTPUT=all.sqlite + +## +## Metabase +## + +METABASE_PORT=3000 + +# Will be placed in the CONFIG_DIR. +METABASE_DATABASE=metabase.db diff --git a/.gitignore b/.gitignore index f8d777a..d39717c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ data/* !data/.gitinclude +config/* +!config/.gitinclude ledgerbil-settings.py \ No newline at end of file diff --git a/config/.gitinclude b/config/.gitinclude new file mode 100644 index 0000000..e69de29 diff --git a/docker-compose.yaml b/docker-compose.yaml index c3b694e..1403097 100755 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -2,16 +2,32 @@ version: "3" services: # TODO: Consider adding https://github.com/sbridges/ledgerble # TODO: Consider adding https://github.com/xitian9/hledger-vega + + metabase: + # https://www.metabase.com/ + # https://github.com/tgrosinger/metabase-multiarch + image: "ghcr.io/tgrosinger/metabase-multiarch:latest" + environment: + - MB_DB_FILE=/data/${SQLITE_OUTPUT} + ports: + - "${METABASE_PORT}:3000" + volumes: + - "${LEDGER_DIR}:/data" + - "${CONFIG_DIR}/${METABASE_DATABASE}:/metabase.db" + ledger-sqlite: # https://github.com/tgrosinger/ledger-sqlite image: "ghcr.io/tgrosinger/ledger-sqlite:latest" environment: - LEDGER_FILE=/data/${PRIMARY_LEDGER_FILE} - - OUTPUT_FILE=/data/ledger.sqlite + - OUTPUT_FILE=/data/${SQLITE_OUTPUT} - OVERWRITE_OUTPUT=true volumes: - "${LEDGER_DIR}:/data" + hledger: + # https://hledger.org + # https://github.com/tgrosinger/hledger-multiarch image: "ghcr.io/tgrosinger/hledger-multiarch:1.26.1" ports: - "${HLEDGER_PORT}:5000"