Skip to content

Conversation

@hulxv
Copy link
Collaborator

@hulxv hulxv commented Dec 16, 2025

Description

This PR refactors the Docker setup to be more robust, configurable, and "Docker-native" by removing the need for generating temporary configuration files.

Key Changes:

  • Docker Compose Profiles: Introduced internal-bitcoind, internal-tor, and external-tor profiles to dynamically control which services are started based on the configuration.
  • Removed File Generation: Deleted generate_compose_file and generate_torrc functions from docker-setup. The setup now relies on a single, parameterized docker-compose.yml and environment variables.
  • Dynamic Configuration:
    • Tor: The Tor container now generates its torrc at runtime (via entrypoint), allowing for a configurable TOR_AUTH_PASSWORD without needing a pre-generated file.
    • Makerd: The Makerd container now generates its config.toml at runtime based on environment variables.
  • Service Improvements:
    • Added a makerd-internal service to handle the network_mode: "service:tor" requirement specifically for the internal Tor profile, while keeping a standard makerd service for external Tor.
    • Added healthcheck for the bitcoind service.
    • Added support for configuring Bitcoin RPC user/password and Tor authentication password via the setup script.
  • Script Enhancements:
    • Created a setup_env function in docker-setup to centralize environment variable export and profile selection.
    • Updated start, stop, and logs commands to use the standard docker-compose.yml with the correct environment context.
    • Enhance logging and guide the user to choose the suitable options.

Close #652

@hulxv hulxv changed the title Refactor docker-compose to use profiles and dynamic Tor configuration refactor: use profiles and dynamic Tor configuration in docker-compose Dec 16, 2025
@hulxv hulxv requested review from mojoX911 and stark-3k December 16, 2025 12:31
@codecov
Copy link

codecov bot commented Dec 16, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 77.49%. Comparing base (776b75d) to head (ea815da).
⚠️ Report is 67 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #659      +/-   ##
==========================================
+ Coverage   68.87%   77.49%   +8.62%     
==========================================
  Files          35       49      +14     
  Lines        4932    14835    +9903     
==========================================
+ Hits         3397    11497    +8100     
- Misses       1535     3338    +1803     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@hulxv hulxv force-pushed the refactor/enhance-dockerfile-setup branch from 26425ff to cfa43c0 Compare December 16, 2025 19:12
@mojoX911 mojoX911 linked an issue Dec 18, 2025 that may be closed by this pull request
@hulxv hulxv marked this pull request as draft December 18, 2025 14:48
@hulxv hulxv force-pushed the refactor/enhance-dockerfile-setup branch 3 times, most recently from 912b62d to a411dfb Compare December 20, 2025 17:43
Copy link

@mojoX911 mojoX911 left a comment

Choose a reason for hiding this comment

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

It did not provide me with any option to change the Tor config ports. I am running a local Tor. But I opted for internal tor also. If it is exposed to the same port as my local Tor it will have an error.

Image

@mojoX911
Copy link

A configuration like below is not being connected to local bitcoind. I suppose it is trying to connect with the internal bitcoind?

[INFO] Configuration Summary
----------------------------------------
Bitcoin Network: signet
Bitcoin Data Dir: /home/coinswap/.bitcoin
Bitcoin RPC Port: 38332
Bitcoin ZMQ Port: 28332
Bitcoin RPC User: user
Use External Bitcoin: true
External Bitcoin Host: localhost:38332
Use External Tor: true
External Tor Host: localhost:9050
Tor Auth Password: coinswap
Makerd Port: 
Makerd RPC Port: 6013
Use Taproot: true

Error:

coinswap-makerd  | DEBUG: TOR_AUTH_PASSWORD is 'coinswap'
coinswap-makerd  | 2025-12-22T14:12:08.188289196+00:00 INFO coinswap::utill - ✅ Logger initialized successfully
coinswap-makerd  | 2025-12-22T14:12:08.188314340+00:00 WARN makerd - Using experimental Taproot-based coinswap protocol
coinswap-makerd  | 2025-12-22T14:12:08.188385528+00:00 INFO coinswap::maker::config - Successfully loaded config file from : /home/coinswap/.coinswap/maker/config.toml
coinswap-makerd  | Error: Watcher(RPCError(JsonRpc(Transport(SocketError(Os { code: 111, kind: ConnectionRefused, message: "Connection refused" })))))
coinswap-makerd exited with code 1 (restarting)

For this config, where I am opting for a locally synced node, it should connect with the bitcoind running outside of Docker. The local bitcoind is not getting any rpc requests.

@hulxv hulxv force-pushed the refactor/enhance-dockerfile-setup branch from f21e66e to 6cc76a3 Compare December 22, 2025 18:03
@hulxv hulxv changed the title refactor: use profiles and dynamic Tor configuration in docker-compose refactor(docker): use profiles and make the docker-compose more configurable Dec 22, 2025
@hulxv hulxv marked this pull request as ready for review December 24, 2025 21:29
@hulxv hulxv requested a review from mojoX911 December 24, 2025 21:29
@mojoX911
Copy link

@hulxv is it possible to directly attach the shell to the makerd logs just after the docker-setup start? Its not obvious for the user that they need to check the log for the next steps of makerd setup.

Maybe we can just run the logs command

@hulxv
Copy link
Collaborator Author

hulxv commented Dec 25, 2025

I want to add an argument to enter logs after start
It will be something like that

./docker-setup start --logs # or -l
./docker-setup restart --logs 

It will enter logs after start the services immediately. What do you think?

@mojoX911
Copy link

It will enter logs after start the services immediately. What do you think?
We should show the makerd logs. Nothing else. Showing all logs will be confusing.

@hulxv hulxv force-pushed the refactor/enhance-dockerfile-setup branch from b3f0b9d to 8924f77 Compare December 29, 2025 17:54
Copy link

@mojoX911 mojoX911 left a comment

Choose a reason for hiding this comment

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

tAck. tested all the paths and things seems to be working as expected. No major comment other than one change in the maker notice copy below.

@hulxv hulxv requested a review from mojoX911 December 30, 2025 15:34
Copy link

@mojoX911 mojoX911 left a comment

Choose a reason for hiding this comment

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

Ack

@hulxv hulxv force-pushed the refactor/enhance-dockerfile-setup branch from 1470fe0 to a11b4ee Compare December 30, 2025 15:39
@hulxv hulxv force-pushed the refactor/enhance-dockerfile-setup branch from a11b4ee to ea815da Compare December 30, 2025 15:57
@mojoX911 mojoX911 merged commit ae9facf into citadel-tech:master Dec 30, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[docker] Configurable Docker Compose

2 participants