build: add docker compose file

This commit is contained in:
Gaze
2024-04-27 01:52:28 +07:00
parent 7e3bfec557
commit 07bcccd102
4 changed files with 88 additions and 0 deletions

1
docker/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
volumes

View File

@@ -0,0 +1,43 @@
logger:
output: text
debug: false
bitcoin_node:
host: "bitcoin-mainnet-archive.allthatnode.com"
user: "user"
pass: "pass"
disable_tls: false
network: mainnet
reporting:
disabled: false
base_url: "https://staging.indexer.api.gaze.network" # defaults to "https://indexer.api.gaze.network" if empty
name: "Local Indexer"
website_url: "" # public website URL to show on the dashboard. Can be left empty.
indexer_api_url: "" # public url to access this api. Can be left empty.
้http_server:
port: 8080
modules:
bitcoin:
database: "postgres" # Store bitcoin data in postgres
postgres:
host: "db"
port: 5432
user: "postgres"
password: "password"
db_name: "postgres"
runes:
database: "postgres" # Store Runes data in postgres
datasource: "postgres" # Fetch bitcoin blocks from postgres
api_handlers:
- http
postgres:
host: "db"
port: 5432
user: "postgres"
password: "password"
db_name: "postgres"

View File

@@ -0,0 +1,44 @@
services:
gaze-migrator:
# image: ghcr.io/gaze-network/gaze-indexer:v0.1.0
build:
context: ../
dockerfile: ./docker/Dockerfile
restart: on-failure
depends_on:
- db
networks:
- indexer
command: ["/app/main", "migrate", "up", "--database", "postgres://postgres:password@db:5432/postgres?sslmode=disable"]
gaze-indexer:
# image: ghcr.io/gaze-network/gaze-indexer:v0.1.0
build:
context: ../
dockerfile: ./docker/Dockerfile
restart: unless-stopped
depends_on:
- db
- gaze-migrator
networks:
- indexer
ports:
- 8080:8080
volumes:
- "./config.example.yaml:/app/config.yaml"
command: ["/app/main", "run", "--bitcoin", "--runes"]
db:
image: postgres:16-alpine
volumes:
- "./volumes/postgresql/data:/var/lib/postgresql/data"
networks:
- indexer
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=password
- POSTGRES_DB=postgres
networks:
indexer:
driver: bridge