306f494cd8
- Dockerfile: node:20-alpine, compiles SCSS at build time, single image used for web server and all sync modes (blocks, peers, markets) - docker-compose.yml: explorer + MongoDB (bind-mounted ./db) on shared 'purple' network alongside bitcoinpurpled and electrumx - docker/entrypoint.sh: generates settings.json from env vars via envsubst, dispatches to web/sync-blocks/sync-peers/reindex modes - docker/settings.json.tmpl: minimal settings template parametrized for BitcoinPurple (coin, wallet RPC, MongoDB, theme) - docker/mongo-init.sh: creates app user in explorerdb on first start - .env.example: pre-filled defaults for BitcoinPurple - CLAUDE.md: codebase guidance for Claude Code - .gitignore: add db/ (MongoDB bind-mount data directory)
103 lines
2.9 KiB
YAML
103 lines
2.9 KiB
YAML
networks:
|
|
purple:
|
|
external: true # shared with purple-stack (bitcoinpurpled, electrumx)
|
|
explorer-internal: # isolates MongoDB from the outside world
|
|
name: purple-explorer-internal
|
|
|
|
services:
|
|
mongodb:
|
|
image: mongo:7
|
|
container_name: purple-explorer-mongodb
|
|
restart: unless-stopped
|
|
networks:
|
|
- explorer-internal
|
|
volumes:
|
|
# Keep MongoDB data in this repository's ./db directory.
|
|
# Do not switch this back to a named Docker volume or the explorer will
|
|
# stop using the already-synced local database.
|
|
- type: bind
|
|
source: ./db
|
|
target: /data/db
|
|
bind:
|
|
create_host_path: true
|
|
- ./docker/mongo-init.sh:/docker-entrypoint-initdb.d/init.sh:ro
|
|
environment:
|
|
# Root admin (used only by the init script to bootstrap the app user)
|
|
MONGO_INITDB_ROOT_USERNAME: mongoadmin
|
|
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD}
|
|
# Passed into mongo-init.sh to create the explorer app user
|
|
MONGO_APP_USER: ${MONGO_USER}
|
|
MONGO_APP_PASS: ${MONGO_PASSWORD}
|
|
MONGO_APP_DB: ${MONGO_DATABASE:-explorerdb}
|
|
logging:
|
|
driver: json-file
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|
|
|
|
explorer:
|
|
build: .
|
|
image: purple-explorer:local
|
|
container_name: purple-explorer
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- mongodb
|
|
networks:
|
|
- purple # reach bitcoinpurpled:13495 for RPC
|
|
- explorer-internal
|
|
ports:
|
|
- "0.0.0.0:${EXPLORER_PORT:-3001}:3001"
|
|
env_file: .env
|
|
command: web
|
|
logging:
|
|
driver: json-file
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|
|
|
|
sync-blocks:
|
|
image: purple-explorer:local
|
|
container_name: purple-explorer-sync-blocks
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- mongodb
|
|
- explorer # ensures the image is built before this runs
|
|
networks:
|
|
- purple # reach bitcoinpurpled RPC
|
|
- explorer-internal
|
|
env_file: .env
|
|
command: sync-blocks
|
|
logging:
|
|
driver: json-file
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|
|
|
|
# sync-markets: disabled until exchanges are configured in docker/settings.json.tmpl
|
|
# To enable: uncomment, configure markets_page.exchanges in the template, then redeploy.
|
|
# sync-markets:
|
|
# image: purple-explorer:local
|
|
# container_name: purple-explorer-sync-markets
|
|
# restart: unless-stopped
|
|
# depends_on: [mongodb]
|
|
# networks: [explorer-internal]
|
|
# env_file: .env
|
|
# command: sync-markets
|
|
|
|
sync-peers:
|
|
image: purple-explorer:local
|
|
container_name: purple-explorer-sync-peers
|
|
restart: unless-stopped
|
|
depends_on:
|
|
- mongodb
|
|
networks:
|
|
- purple # reach bitcoinpurpled for peer info
|
|
- explorer-internal
|
|
env_file: .env
|
|
command: sync-peers
|
|
logging:
|
|
driver: json-file
|
|
options:
|
|
max-size: "10m"
|
|
max-file: "3"
|