Skip to content

feat(docker): add data persistence to docker-compose#834

Open
unwrap-nicolas wants to merge 1 commit intogetfloresta:masterfrom
unwrap-nicolas:feat/docker-persistence
Open

feat(docker): add data persistence to docker-compose#834
unwrap-nicolas wants to merge 1 commit intogetfloresta:masterfrom
unwrap-nicolas:feat/docker-persistence

Conversation

@unwrap-nicolas
Copy link

@unwrap-nicolas unwrap-nicolas commented Feb 7, 2026

Description and Notes

fixed #795

this PR addresses the lack of data persistence and network flexibility in the current docker-compose.yml setup.

currently, users running docker compose up experience:

  • Data loss on container restart — blockchain data, Prometheus metrics, and Grafana dashboards are lost every time containers are recreated
  • Mainnet-only — no way to run on signet, testnet, or other networks without manually editing the compose file

Changes

Data Persistence:

  • Adds named Docker volumes for Floresta, Prometheus, and Grafana
  • Supports FLORESTA_DATA environment variable to reuse existing local blockchain data (useful for sharing data between native and Docker installations)

Network Configuration:

  • Adds NETWORK environment variable to easily switch between Bitcoin networks (bitcoin, signet, testnet, testnet4, regtest)
  • Forces fixed internal ports (50001 for Electrum, 8332 for RPC) with --rpc-address and --electrum-address flags, avoiding port conflicts when changing networks

Documentation:

  • Updates doc/docker.md with examples for running different networks and using local data directories

How to verify the changes you have done?

Start the stack: docker compose up -d or NETWORK=signet FLORESTA_DATA=$HOME/.floresta docker compose up

@moisesPompilio moisesPompilio added the enhancement New feature or request label Feb 7, 2026
@luisschwab
Copy link
Member

Should be marked as draft until 639 is merged

@unwrap-nicolas unwrap-nicolas marked this pull request as draft February 8, 2026 09:48
@Davidson-Souza
Copy link
Member

Davidson-Souza commented Feb 11, 2026

Why does this need #639? I think you can just drop it and leave the persistence part

@unwrap-nicolas unwrap-nicolas force-pushed the feat/docker-persistence branch from 4203acb to 0808d85 Compare February 12, 2026 15:32
@unwrap-nicolas
Copy link
Author

@Davidson-Souza actually, my goal with this PR is to get the monitoring stack running 100% smoothly with docker-compose.

One issue I noticed was the lack of persistence. However, while fixing that, I realized that PR #639 doesn't fully accomplish its goal of "provisioning grafana dashboards via docker-compose"

But your point makes sense. I've updated this PR's description and removed those specific fixes. I also added them as suggestions on PR #639.

Thanks for the review!

@unwrap-nicolas unwrap-nicolas marked this pull request as ready for review February 12, 2026 16:14
command: >-
florestad --data-dir /data/.floresta
-n ${NETWORK:-bitcoin}
--rpc-address 0.0.0.0:8332
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which port we are using depends on the network. Do you think it's possible to switch ports given the network?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement] Align docker-compose.yml with persistence docs and improve dev workflow

4 participants