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
6 changes: 2 additions & 4 deletions indexer/Dockerfile.development → Dockerfile.development
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ FROM node:18-alpine

WORKDIR /app

COPY package.json .
COPY ./indexer ./yarn.lock ./
RUN yarn install --frozen-lockfile
RUN yarn global add ts-node dotenv-cli

COPY . .
RUN yarn global add ts-node dotenv-cli sequelize-cli

EXPOSE 3001

Expand Down
43 changes: 9 additions & 34 deletions indexer/docker-compose.development.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ services:
POSTGRES_DB: ${DB_NAME}
ports:
- "5432:5432"
volumes:
- ${PWD}/indexer/postgres:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USERNAME}"]
interval: 10s
Expand All @@ -18,66 +20,39 @@ services:

db-migration:
build:
context: .
context: ../
dockerfile: Dockerfile.development
container_name: db-migration
environment:
DB_HOST: indexer-db
command: >
/bin/sh -c "
rm -f /app/shared/db-migration-complete &&
rm -f /app/shared/graphql-running &&
yarn create:database &&
touch /app/shared/db-migration-complete"
command: ["yarn", "create:database"]
depends_on:
indexer-db:
condition: service_healthy
volumes:
- shared-data:/app/shared

graphql-app:
build:
context: .
context: ../
dockerfile: Dockerfile.development
container_name: kad-indexer-graphql
environment:
DB_HOST: indexer-db
command: >
/bin/sh -c "
while [ ! -f /app/shared/db-migration-complete ]; do
echo 'Waiting for db-migration...';
sleep 6;
done &&
touch /app/shared/graphql-running &&
yarn dev:graphql"
command: ["yarn", "dev:graphql"]
ports:
- "3001:3001"
depends_on:
db-migration:
condition: service_started
volumes:
- shared-data:/app/shared
condition: service_completed_successfully

streaming-app:
build:
context: .
context: ../
dockerfile: Dockerfile.development
container_name: kad-indexer-streaming
environment:
DB_HOST: indexer-db
KADENA_GRAPHQL_API_URL: http://graphql-app
command: >
/bin/sh -c "
while [ ! -f /app/shared/graphql-running ]; do
echo 'Waiting for graphql-app...';
sleep 6;
done &&
yarn dev:streaming"
command: ["yarn", "dev:streaming"]
depends_on:
graphql-app:
condition: service_started
volumes:
- shared-data:/app/shared

volumes:
shared-data:
Loading