Skip to content
Open
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: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
index
.gitignore
Dockerfile
docker-compose.yaml
README.md
LICENSE
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@
example.db
.DS_Store
/client/examples/example-linux
docker/bitcoin-data
docker/indexer-data
13 changes: 13 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM golang:1.22

WORKDIR /usr/src/app

# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change
COPY go.mod go.sum ./
RUN go mod download && go mod verify

EXPOSE 26770
COPY . .
RUN go build .
RUN chmod +x index
CMD ["./index", "serve", "live"]
32 changes: 32 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
version: "3"
services:
bitcoind:
image: zquestz/bitcoin-cash-node
# specify additional command line arguments here
command: bitcoind
healthcheck:
test: ["CMD", "/entrypoint.sh", "bitcoin-cli", "getblockchaininfo"]
volumes:
- ./docker/bitcoin-data:/data
- ./docker/bitcoin.conf:/data/bitcoin.conf
networks:
- bitcoin
indexer:
build: .
ports:
- "${PORT}:26770"
volumes:
- ./docker/indexer-data:/usr/src/app/db/data
depends_on:
- bitcoind
networks:
- bitcoin
environment:
- 'NODE_HOST=[bitcoind]:8333'
- 'SERVER_HOST=0.0.0.0'

networks:
bitcoin:

volumes:
bitcoin-data:
1 change: 1 addition & 0 deletions docker/bitcoin.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
txindex=1