```
services:
bitcoind:
container_name: bitcoind
image: lncm/bitcoind:v28.0
user: "1000:1000" # run process with user 1000 (bitcoind user in container)
group_add:
- "${DEBIAN_TOR_GID}" # add user 1000 to debian-tor group (debian-tor group in host machine) to read tor control.authcookie file
volumes:
- ~/data/bitcoin/:/data/.bitcoin/ # where to store bitcoin data
- /run/tor/control.authcookie:/run/tor/control.authcookie:ro # map tor control.authcookie for authentication
ports:
- "8334:8334" # expose port 8334 to receive incoming peer from tor network
networks:
- ext_bitcoind_bridge # use external network to prevent ip changing after docker compose down and up again
networks:
ext_bitcoind_bridge:
external: true
name: bitcoind_bridge # need to run 'docker network create bitcoind_bridge' before docker compose up
```
7. docker compose up -d
8. ถ้าใช้ firewall ร่วมด้วยก็ต้องไป allow proxy port กับ control port ของ tor ให้เชื่อมต่อจาก docker network ได้ด้วย