Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,13 @@ 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.
For local setup instructions, see the [Docker Compose README](docker/README.md).

## 🤝 Contributing

Thanks for considering contributing and helping us on creating GovTool! 😎

Please checkout our [Contributing Documentation](./CONTRIBUTING.md).
Please checkout our [Contributing Documentation](./CONTRIBUTING.md).
19 changes: 19 additions & 0 deletions docker/.env.example
Original file line number Diff line number Diff line change
@@ -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=""
50 changes: 50 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# 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 environment
From the repo root

```bash
cd docker
cp .env.example .env
```
> [!NOTE]
> Update the backend config file used by the `govtool-backend` service in [`example-config.json`](../govtool/backend/example-config.json) before starting the stack.

Also fill in the db-sync details and required URLs in the outcomes env file. Create env files for the frontend and metadata-validation services from their examples if they are not already present.

Note: The `.env.example` in this folder is for the outcomes service only.

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

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

69 changes: 69 additions & 0 deletions docker/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
services:
govtool-backend:
image: ghcr.io/intersectmbo/govtool-backend:dev
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:dev
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:dev
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

Loading