|
| 1 | +version: '3.8' |
| 2 | + |
| 3 | +services: |
| 4 | + indexer-db: |
| 5 | + image: postgres |
| 6 | + container_name: kad-indexer-postgres |
| 7 | + environment: |
| 8 | + POSTGRES_USER: ${DB_USERNAME} |
| 9 | + POSTGRES_PASSWORD: ${DB_PASSWORD} |
| 10 | + POSTGRES_DB: ${DB_NAME} |
| 11 | + ports: |
| 12 | + - "5432:5432" |
| 13 | + healthcheck: |
| 14 | + test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME}"] |
| 15 | + interval: 10s |
| 16 | + timeout: 5s |
| 17 | + retries: 5 |
| 18 | + |
| 19 | + db-migration: |
| 20 | + build: |
| 21 | + context: . |
| 22 | + dockerfile: Dockerfile.development |
| 23 | + container_name: db-migration |
| 24 | + environment: |
| 25 | + DB_HOST: indexer-db |
| 26 | + command: > |
| 27 | + /bin/sh -c " |
| 28 | + rm -f /app/shared/db-migration-complete && |
| 29 | + rm -f /app/shared/graphql-running && |
| 30 | + yarn create:database && |
| 31 | + touch /app/shared/db-migration-complete" |
| 32 | + depends_on: |
| 33 | + indexer-db: |
| 34 | + condition: service_healthy |
| 35 | + volumes: |
| 36 | + - shared-data:/app/shared |
| 37 | + |
| 38 | + graphql-app: |
| 39 | + build: |
| 40 | + context: . |
| 41 | + dockerfile: Dockerfile.development |
| 42 | + container_name: kad-indexer-graphql |
| 43 | + environment: |
| 44 | + DB_HOST: indexer-db |
| 45 | + command: > |
| 46 | + /bin/sh -c " |
| 47 | + while [ ! -f /app/shared/db-migration-complete ]; do |
| 48 | + echo 'Waiting for db-migration...'; |
| 49 | + sleep 6; |
| 50 | + done && |
| 51 | + touch /app/shared/graphql-running && |
| 52 | + yarn dev:graphql" |
| 53 | + ports: |
| 54 | + - "3001:3001" |
| 55 | + depends_on: |
| 56 | + db-migration: |
| 57 | + condition: service_started |
| 58 | + volumes: |
| 59 | + - shared-data:/app/shared |
| 60 | + |
| 61 | + streaming-app: |
| 62 | + build: |
| 63 | + context: . |
| 64 | + dockerfile: Dockerfile.development |
| 65 | + container_name: kad-indexer-streaming |
| 66 | + environment: |
| 67 | + DB_HOST: indexer-db |
| 68 | + KADENA_GRAPHQL_API_URL: http://graphql-app |
| 69 | + command: > |
| 70 | + /bin/sh -c " |
| 71 | + while [ ! -f /app/shared/graphql-running ]; do |
| 72 | + echo 'Waiting for graphql-app...'; |
| 73 | + sleep 6; |
| 74 | + done && |
| 75 | + yarn dev:streaming" |
| 76 | + depends_on: |
| 77 | + graphql-app: |
| 78 | + condition: service_started |
| 79 | + volumes: |
| 80 | + - shared-data:/app/shared |
| 81 | + |
| 82 | +volumes: |
| 83 | + shared-data: |
0 commit comments