Skip to content

Commit

Permalink
historic positions cache (#394)
Browse files Browse the repository at this point in the history
  • Loading branch information
bergarces authored Feb 11, 2025
1 parent 52768aa commit e161c6d
Show file tree
Hide file tree
Showing 162 changed files with 8,737 additions and 4,940 deletions.
11 changes: 11 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
node_modules
**/node_modules

dist
**/dist
**/*.tsbuildinfo

.git
.gitignore

databases
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,6 @@ dist
*.tsbuildinfo

*db-shm
*db-wal
*db-wal

databases/*_index_history.db
16 changes: 16 additions & 0 deletions Dockerfile.api
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM node:20

WORKDIR /app

COPY package*.json ./
COPY packages/adapters-library/package*.json ./packages/adapters-library/
COPY packages/adapters-api/package*.json ./packages/adapters-api/
COPY packages/workers/package*.json ./packages/workers/

RUN npm ci

COPY . .

RUN npm run build

CMD ["node", "packages/adapters-api/index.js"]
17 changes: 17 additions & 0 deletions Dockerfile.workers
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM node:20

WORKDIR /app

RUN npm install -g pm2

COPY package*.json ./
COPY packages/adapters-library/package*.json ./packages/adapters-library/
COPY packages/workers/package*.json ./packages/workers/

RUN npm ci

COPY . .

RUN npm run build

CMD ["pm2-runtime", "start", "packages/workers/pm2.config.json"]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
44 changes: 44 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
services:
api:
build:
context: .
dockerfile: Dockerfile.api
ports:
- "3000:3000"
volumes:
- sqlite_data:/app/databases
environment:
- DEFI_ADAPTERS_PROVIDER_ETHEREUM
- DEFI_ADAPTERS_PROVIDER_OPTIMISM
- DEFI_ADAPTERS_PROVIDER_BSC
- DEFI_ADAPTERS_PROVIDER_POLYGON
- DEFI_ADAPTERS_PROVIDER_FANTOM
- DEFI_ADAPTERS_PROVIDER_BASE
- DEFI_ADAPTERS_PROVIDER_ARBITRUM
- DEFI_ADAPTERS_PROVIDER_AVALANCHE
- DEFI_ADAPTERS_PROVIDER_LINEA
- DEFI_ADAPTERS_USE_POSITIONS_CACHE
workers:
build:
context: .
dockerfile: Dockerfile.workers
volumes:
- sqlite_data:/app/databases
environment:
- DEFI_ADAPTERS_PROVIDER_ETHEREUM
- DEFI_ADAPTERS_PROVIDER_OPTIMISM
- DEFI_ADAPTERS_PROVIDER_BSC
- DEFI_ADAPTERS_PROVIDER_POLYGON
- DEFI_ADAPTERS_PROVIDER_FANTOM
- DEFI_ADAPTERS_PROVIDER_BASE
- DEFI_ADAPTERS_PROVIDER_ARBITRUM
- DEFI_ADAPTERS_PROVIDER_AVALANCHE
- DEFI_ADAPTERS_PROVIDER_LINEA

volumes:
sqlite_data:
driver: local
driver_opts:
type: none
o: bind
device: ${PWD}/databases
Loading

0 comments on commit e161c6d

Please sign in to comment.