services: builder: build: context: . dockerfile: Dockerfile.lein working_dir: /builder volumes: - jar-volume:/builder/target - .:/builder command: > sh -c "set -x && rm -f /builder/target/gizmosql.metabase-driver-standalone.jar && lein uberjar" restart: "no" metabase: image: metabase/metabase:v0.63.19.1 hostname: metabase depends_on: - postgres - gizmosql - builder volumes: - jar-volume:/builder/target - /dev/urandom:/dev/random:ro command: > sh -c "while [ ! -f /builder/target/gizmosql.metabase-driver-standalone.jar ]; do echo 'Waiting for jar file...'; sleep 5; done && sleep 10 && cp /builder/target/gizmosql.metabase-driver-standalone.jar /plugins/gizmosql-metabase-driver.jar && echo 'Plugin copied, starting Metabase' && exec /app/run_metabase.sh" ports: - "3000:3000" environment: # The v0.63 image runs JDK 25 (v0.62 ran JDK 21). Arrow's memory # allocator needs (a) reflective access to java.nio internals and # (b) sun.misc.Unsafe memory access, which JDK 24+ disables by default # (JEP 498) — without these flags the driver dies with # "Could not initialize class ...arrow.memory.RootAllocator". JAVA_OPTS: >- --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --sun-misc-unsafe-memory-access=allow --enable-native-access=ALL-UNNAMED -Dio.netty.tryReflectionSetAccessible=true MB_DB_TYPE: postgres MB_DB_DBNAME: metabaseappdb MB_DB_PORT: 5432 MB_DB_USER: metabase MB_DB_PASS: mysecretpassword MB_DB_HOST: postgres networks: - metanet1 healthcheck: test: ["CMD", "curl", "--fail", "-I", "http://localhost:3000/api/health"] interval: 15s timeout: 5s retries: 5 postgres: image: postgres:17.10 hostname: postgres volumes: - pgdata:/var/lib/postgresql/data environment: POSTGRES_USER: metabase POSTGRES_DB: metabaseappdb POSTGRES_PASSWORD: mysecretpassword networks: - metanet1 gizmosql: # Pinned (releases are near-weekly); a -slim and an LTS channel # (gizmodata/gizmosql-lts) also exist. image: gizmodata/gizmosql:v1.40.0 hostname: gizmosql volumes: - type: bind source: ./gizmosql/init.sql target: /opt/gizmosql/init.sql environment: TLS_ENABLED: "false" GIZMOSQL_USERNAME: "gizmosql" GIZMOSQL_PASSWORD: "gizmosql_password" # Signs the session JWTs the server issues after basic auth. Without a # stable value, every container restart invalidates the bearer tokens # Metabase's pooled connections retained (retainAuth) -> auth errors # until the pool cycles. Demo value; use a real secret in production. SECRET_KEY: "gizmosql-demo-jwt-signing-key-0123456789abcdef" PRINT_QUERIES: "1" DATABASE_FILENAME: ":memory:" INIT_SQL_COMMANDS_FILE: "/opt/gizmosql/init.sql" ports: - "31337:31337" networks: - metanet1 # SMTP sink for testing alerts/subscriptions delivery (web UI + REST API # on :1080, SMTP on :1025). Metabase email settings are configured by the # e2e suite. maildev: image: maildev/maildev:3.0.0 hostname: maildev ports: - "1080:1080" - "1025:1025" networks: - metanet1 networks: metanet1: driver: bridge volumes: pgdata: jar-volume: