Skip to content
Open
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
42 changes: 42 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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! 😎
Expand Down
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=""
51 changes: 51 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
@@ -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


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: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