mirror of
https://github.com/Permissionless-Software-Foundation/psf-memo-indexer.git
synced 2026-09-21 16:52:02 -07:00
Moving docker files
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
FROM node:20-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm ci --omit=dev
|
||||
|
||||
COPY . .
|
||||
|
||||
CMD ["node", "--max-old-space-size=8192", "psf-memo-block-indexer.js"]
|
||||
@@ -1,10 +0,0 @@
|
||||
FROM node:20-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm ci --omit=dev
|
||||
|
||||
COPY . .
|
||||
|
||||
CMD ["node", "--max-old-space-size=4096", "psf-memo-tx-indexer.js"]
|
||||
@@ -64,6 +64,21 @@ See `.env-example`. Key variables:
|
||||
npm test
|
||||
```
|
||||
|
||||
## Production (Docker)
|
||||
|
||||
Docker files live under [production/docker](./production/docker), matching [psf-slp-indexer-g2](https://github.com/Permissionless-Software-Foundation/psf-slp-indexer-g2):
|
||||
|
||||
```bash
|
||||
cd production/docker
|
||||
cp block-indexer/.env-example block-indexer/.env
|
||||
cp tx-indexer/.env-example tx-indexer/.env
|
||||
cp memo-db/.env-example memo-db/.env
|
||||
docker-compose build
|
||||
docker-compose up -d
|
||||
```
|
||||
|
||||
Services: `memo-db` (port 5021), `block-indexer`, `tx-indexer` (port 5455).
|
||||
|
||||
## License
|
||||
|
||||
GPL v3
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
# Environment variables for psf-memo-block-indexer
|
||||
# Copy this file to .env and modify as needed
|
||||
|
||||
PSF_MEMO_DB_URL=http://172.17.0.1:5021
|
||||
|
||||
RPC_IP=172.17.0.1
|
||||
RPC_PORT=8332
|
||||
ZMQ_PORT=28332
|
||||
RPC_USER=bitcoin
|
||||
RPC_PASS=password
|
||||
|
||||
TX_REST_API_PORT=5455
|
||||
TX_REST_API_IP=172.17.0.1
|
||||
|
||||
START_BLOCK_HEIGHT=525000
|
||||
EXIT_ON_MISSING_BACKUP=false
|
||||
@@ -0,0 +1,11 @@
|
||||
FROM node:20-alpine
|
||||
|
||||
WORKDIR /home/safeuser/psf-memo-indexer
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm ci --omit=dev
|
||||
|
||||
COPY . .
|
||||
|
||||
VOLUME start-block-indexer.sh
|
||||
CMD ["./start-block-indexer.sh"]
|
||||
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
node --max-old-space-size=8192 psf-memo-block-indexer.js
|
||||
@@ -0,0 +1,52 @@
|
||||
# Start the service with: docker-compose up -d
|
||||
|
||||
services:
|
||||
memo-db:
|
||||
build:
|
||||
context: ../../psf-memo-db
|
||||
dockerfile: ./memo-db/Dockerfile
|
||||
container_name: memo-db
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: 10m
|
||||
max-file: '10'
|
||||
ports:
|
||||
- '5021:5021'
|
||||
volumes:
|
||||
- ../data/leveldb:/home/safeuser/psf-memo-db/leveldb
|
||||
- ./memo-db/start-memo-db.sh:/home/safeuser/psf-memo-db/start-memo-db.sh
|
||||
- ./memo-db/.env:/home/safeuser/psf-memo-db/.env
|
||||
restart: always
|
||||
|
||||
tx-indexer:
|
||||
build:
|
||||
context: ../..
|
||||
dockerfile: production/docker/tx-indexer/Dockerfile
|
||||
container_name: memo-tx-indexer
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: 10m
|
||||
max-file: '10'
|
||||
ports:
|
||||
- '5455:5455'
|
||||
volumes:
|
||||
- ./tx-indexer/start-tx-indexer.sh:/home/safeuser/psf-memo-indexer/start-tx-indexer.sh
|
||||
- ./tx-indexer/.env:/home/safeuser/psf-memo-indexer/.env
|
||||
restart: always
|
||||
|
||||
block-indexer:
|
||||
build:
|
||||
context: ../..
|
||||
dockerfile: production/docker/block-indexer/Dockerfile
|
||||
container_name: memo-block-indexer
|
||||
logging:
|
||||
driver: json-file
|
||||
options:
|
||||
max-size: 10m
|
||||
max-file: '10'
|
||||
volumes:
|
||||
- ./block-indexer/start-block-indexer.sh:/home/safeuser/psf-memo-indexer/start-block-indexer.sh
|
||||
- ./block-indexer/.env:/home/safeuser/psf-memo-indexer/.env
|
||||
restart: always
|
||||
@@ -0,0 +1,4 @@
|
||||
PORT=5021
|
||||
SVC_ENV=prod
|
||||
BACKUP_QTY=3
|
||||
EXIT_ON_MISSING_BACKUP=false
|
||||
@@ -0,0 +1,13 @@
|
||||
FROM node:20-alpine
|
||||
|
||||
WORKDIR /home/safeuser/psf-memo-db
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm ci --omit=dev
|
||||
|
||||
COPY . .
|
||||
|
||||
EXPOSE 5021
|
||||
|
||||
VOLUME start-memo-db.sh
|
||||
CMD ["./start-memo-db.sh"]
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
node index.js
|
||||
@@ -0,0 +1,15 @@
|
||||
# Environment variables for psf-memo-tx-indexer
|
||||
# Copy this file to .env and modify as needed
|
||||
|
||||
PSF_MEMO_DB_URL=http://172.17.0.1:5021
|
||||
|
||||
RPC_IP=172.17.0.1
|
||||
RPC_PORT=8332
|
||||
ZMQ_PORT=28332
|
||||
RPC_USER=bitcoin
|
||||
RPC_PASS=password
|
||||
|
||||
TX_REST_API_PORT=5455
|
||||
TX_REST_API_IP=172.17.0.1
|
||||
|
||||
SEEN_TX_MAX=100000
|
||||
@@ -0,0 +1,13 @@
|
||||
FROM node:20-alpine
|
||||
|
||||
WORKDIR /home/safeuser/psf-memo-indexer
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm ci --omit=dev
|
||||
|
||||
COPY . .
|
||||
|
||||
EXPOSE 5455
|
||||
|
||||
VOLUME start-tx-indexer.sh
|
||||
CMD ["./start-tx-indexer.sh"]
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
node --max-old-space-size=4096 psf-memo-tx-indexer.js
|
||||
Reference in New Issue
Block a user