From 3197bc207b113263b8217587740d431df0a2be20 Mon Sep 17 00:00:00 2001 From: Kushal Acharya Date: Tue, 21 Jul 2026 10:49:30 +0545 Subject: [PATCH 1/2] docker compose --- docker/.env.example | 19 +++++++++++ docker/README.md | 51 ++++++++++++++++++++++++++++ docker/docker-compose.yaml | 69 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 139 insertions(+) create mode 100644 docker/.env.example create mode 100644 docker/README.md create mode 100644 docker/docker-compose.yaml diff --git a/docker/.env.example b/docker/.env.example new file mode 100644 index 000000000..d05cd6fcd --- /dev/null +++ b/docker/.env.example @@ -0,0 +1,19 @@ +DBSYNC_POSTGRES_HOST= +DBSYNC_POSTGRES_PORT= +DBSYNC_POSTGRES_USER= +DBSYNC_POSTGRES_PASSWORD= +DBSYNC_DATABASE= +APP_ENV="development" +BASE_URL="http://localhost:9999" +METADATA_API_URL="http://localhost:3000" +NETWORK_FLAG=0 +SENTRY_DSN="" +GTM_ID="" +IS_DEV=true +USERSNAP_SPACE_API_KEY="" +IS_PROPOSAL_DISCUSSION_FORUM_ENABLED='false' +IS_GOVERNANCE_OUTCOMES_PILLAR_ENABLED='true' +PDF_API_URL="" +OUTCOMES_API_URL="http://localhost:3001/" +IPFS_GATEWAY="https://ipfs.io/ipfs" +IPFS_PROJECT_ID="" \ No newline at end of file diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 000000000..a0c98edd8 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,51 @@ +# GovTool Docker Compose + +This folder contains a compose file for running GovTool services locally. + +## Prerequisites +- Docker and Docker Compose +- A reachable db-sync Postgres instance + +## Configure outcomes environment +Copy the example file and fill in the db-sync details and required URLs. Also create env files for the frontend and metadata-validation services from their examples. Make sure the backend config file is present. + +Note: The .env.example in this foler is for outcomes service only. + +```bash +cp docker/.env.example docker/.env +``` + +Edit docker/.env with real values: +- DBSYNC_POSTGRES_HOST +- DBSYNC_POSTGRES_PORT +- DBSYNC_DATABASE +- DBSYNC_POSTGRES_USER +- DBSYNC_POSTGRES_PASSWORD +- IPFS_GATEWAY +- PDF_API_URL + +## Start services +From the repo root: + +```bash +cd docker +``` + +Option A: build locally (uses Dockerfiles) +```bash +docker compose up -d --build +``` + +Option B: use images only (no build) +```bash +docker compose pull +docker compose up -d --no-build +``` + +## Service endpoints +- Frontend: http://localhost +- Backend API: http://localhost:9999 +- Metadata validation: http://localhost:3000 +- Outcomes API: http://localhost:3001 + + diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml new file mode 100644 index 000000000..04ac7ab52 --- /dev/null +++ b/docker/docker-compose.yaml @@ -0,0 +1,69 @@ +services: + govtool-backend: + image: ghcr.io/intersectmbo/govtool-backend:8f242130c1a8f5dee52fd6562f9b0424dc944afd + build: + context: ../govtool/backend + volumes: + - ../govtool/backend/example-config.json:/config.json:ro + entrypoint: + - sh + - -c + - vva-be -c /config.json start-app + ports: + - "9999:9999" + + metadata-validation: + image: ghcr.io/intersectmbo/govtool-metadata-validation:8f242130c1a8f5dee52fd6562f9b0424dc944afd + build: + context: ../govtool/metadata-validation + dockerfile: Dockerfile + environment: + - PORT=3000 + env_file: + - ../govtool/metadata-validation/.env + + ports: + - "3000:3000" + + outcomes: + image: ghcr.io/intersectmbo/govtool-outcomes-pillar-backend:acf1032dae36691f8bc6af2b8e90a9b7917a557e-91 + env_file: + - ./.env + environment: + DATABASE_HOST: ${DBSYNC_POSTGRES_HOST} + DATABASE_PORT: ${DBSYNC_POSTGRES_PORT:-5432} + DATABASE_NAME: ${DBSYNC_DATABASE} + DATABASE_USER: ${DBSYNC_POSTGRES_USER} + DATABASE_PASSWORD: ${DBSYNC_POSTGRES_PASSWORD} + IPFS_GATEWAY: ${IPFS_GATEWAY} + PDF_API_URL: ${PDF_API_URL} + ports: + - "3001:3000" + + govtool-frontend: + image: ghcr.io/intersectmbo/govtool-frontend:8f242130c1a8f5dee52fd6562f9b0424dc944afd + build: + context: ../govtool/frontend + dockerfile: Dockerfile + env_file: + - ./.envs + environment: + VITE_BASE_URL: ${BASE_URL} + VITE_SENTRY_DSN: ${SENTRY_DSN_FRONTEND:-} + VITE_APP_ENV: ${APP_ENV:-test} + VITE_NETWORK_FLAG: ${VITE_NETWORK_FLAG:-0} + VITE_USERSNAP_SPACE_API_KEY: ${USERSNAP_SPACE_API_KEY:-} + VITE_IS_PROPOSAL_DISCUSSION_FORUM_ENABLED: 'true' + VITE_METADATA_API_URL: ${METADATA_API_URL} + VITE_GTM_ID: ${GTM_ID:-} + VITE_PDF_API_URL: ${PDF_API_URL:-} + VITE_OUTCOMES_API_URL: ${OUTCOMES_API_URL:-} + VITE_IPFS_GATEWAY: ${IPFS_GATEWAY:-https://ipfs.io/ipfs} + VITE_IPFS_PROJECT_ID: ${IPFS_PROJECT_ID:-} + VITE_IS_GOVERNANCE_OUTCOMES_PILLAR_ENABLED: 'true' + ports: + - "80:80" + depends_on: + - govtool-backend + - metadata-validation + \ No newline at end of file From 605a8bca0199fc248bb4f53102b3465fe3603c30 Mon Sep 17 00:00:00 2001 From: Kushal Acharya Date: Thu, 30 Jul 2026 16:25:05 +0545 Subject: [PATCH 2/2] feat: update readme with docker compose infromation --- README.md | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/README.md b/README.md index 5fb7b8912..973f5fb01 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,48 @@ The API exposes endpoints making the querying of governance related data from DB GovTool frontend web app communicates with the backend over a REST interface, reading and displaying on-chain governance data. Frontend is able to connect to Cardano wallets over the [CIP-30](https://github.com/cardano-foundation/CIPs/blob/master/CIP-0030/README.md) and [CIP-95](https://github.com/cardano-foundation/CIPs/blob/master/CIP-0095/README.md) standards. +## 🐳 Running locally with docker + +This repository includes a Docker Compose setup for running GovTool services locally. + +### Prerequisites +- Docker and Docker Compose +- A reachable db-sync Postgres instance + +### Configure environment +Copy the example environment file and fill in the db-sync details and required URLs. Also create env files for the frontend and metadata-validation services from their examples, and make sure the backend config file is present. + +```bash +cp docker/.env.example docker/.env +``` + +Edit docker/.env with the required values for: +- DBSYNC_POSTGRES_HOST +- DBSYNC_POSTGRES_PORT +- DBSYNC_DATABASE +- DBSYNC_POSTGRES_USER +- DBSYNC_POSTGRES_PASSWORD +- IPFS_GATEWAY +- PDF_API_URL + +### Start services +From the repo root: + +```bash +cd docker +``` + +Option A: build locally (uses Dockerfiles) +```bash +docker compose up -d --build +``` + +Option B: use images only (no build) +```bash +docker compose pull +docker compose up -d --no-build +``` + ## 🤝 Contributing Thanks for considering contributing and helping us on creating GovTool! 😎