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
2 changes: 1 addition & 1 deletion indexer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ sudo docker run --env-file ./indexer/.env -p 3000:3000 kadena-indexer:latest

### 4.4. Running with Docker Compose

Docker Compose provides a way to run the entire indexer stack with a single command. While you could run each service separately (database, migrations, GraphQL server, and streaming service), Docker Compose orchestrates all these components together, handling their dependencies and startup order automatically. The services are defined in `docker-compose.development.yml`, which includes:
Docker Compose provides a way to run the entire indexer stack with a single command. While you could run each service separately (database, migrations, GraphQL server, and streaming service), Docker Compose orchestrates all these components together, handling their dependencies and startup order automatically. The services are defined in `docker-compose.yml`, which includes:
- PostgreSQL database
- Database migrations
- GraphQL API server
Expand Down
58 changes: 0 additions & 58 deletions indexer/docker-compose.development.yml

This file was deleted.

79 changes: 49 additions & 30 deletions indexer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,39 +1,58 @@
version: "3.8"
version: '3.8'

services:
indexer:
build: ../.
env_file:
- ./.env
indexer-db:
image: postgres
container_name: kad-indexer-postgres
environment:
POSTGRES_USER: ${DB_USERNAME}
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
ports:
- "3000:3000"
command: yarn dev:run
networks:
- monitoring

prometheus:
image: prom/prometheus
- "5432:5432"
volumes:
- ./src/server/prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
command:
- "--config.file=/etc/prometheus/prometheus.yml"
- ${PWD}/indexer/postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME}"]
interval: 10s
timeout: 5s
retries: 5

db-migration:
build:
context: ../
dockerfile: Dockerfile.development
container_name: db-migration
environment:
DB_HOST: indexer-db
command: ["yarn", "create:database"]
depends_on:
- indexer
networks:
- monitoring
indexer-db:
condition: service_healthy

grafana:
image: grafana/grafana
ports:
- "3001:3000"
graphql-app:
build:
context: ../
dockerfile: Dockerfile.development
container_name: kad-indexer-graphql
environment:
- GF_SERVER_HTTP_PORT=3000
DB_HOST: indexer-db
command: ["yarn", "dev:graphql"]
ports:
- "3001:3001"
depends_on:
- prometheus
networks:
- monitoring
db-migration:
condition: service_completed_successfully

networks:
monitoring:
streaming-app:
build:
context: ../
dockerfile: Dockerfile.development
container_name: kad-indexer-streaming
environment:
DB_HOST: indexer-db
KADENA_GRAPHQL_API_URL: http://graphql-app
command: ["yarn", "dev:streaming"]
depends_on:
graphql-app:
condition: service_started
2 changes: 1 addition & 1 deletion indexer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
},
"scripts": {
"create:database": "ts-node src/index.ts --database && yarn migrate:up",
"dev": "docker-compose -f docker-compose.development.yml up && docker-compose logs -f indexer",
"dev": "docker-compose -f docker-compose.yml up && docker-compose logs -f indexer",
"dev:database": "ts-node src/index.ts --database",
"dev:streaming": "ts-node src/index.ts --streaming",
"dev:graphql": "ts-node src/index.ts --graphql",
Expand Down
Loading