Skip to content

Commit 270cf1d

Browse files
authored
V2024.6
* Add USER_ID param and update some services * Add gitignore
1 parent 142987e commit 270cf1d

9 files changed

Lines changed: 47 additions & 21 deletions

File tree

.env.example

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,57 @@
1+
# Group identifier for file sharing betweenthe local machine and the containers.
2+
# Check the installation documentation for more details.
3+
SHARED_GID=1099
4+
15
# Tor expert bundle version and platform to build the container.
26
# To be obtained from this site: https://gitweb.torproject.org/tor.git
37
# Example: tor-0.4.8.10
4-
TOR_VERSION=0.4.8.11
5-
TOR_DATA=./volumes/tor
8+
TOR_VERSION=0.4.8.12
69

7-
# Group identifier for file sharing betweenthe local machine and the containers.
8-
# Check the installation documentation for more details.
9-
SHARED_GID=1099
10+
# User identifier used for tor inside the container
11+
TOR_USER_ID=1099
12+
13+
# Directory on the host machine where to moutn the data volume for tor
14+
TOR_DATA=./volumes/tor
1015

1116
# Bitcoin core version and platform to build the container.
1217
# To be obtained from this site: https://github.com/bitcoin/bitcoin/releases
1318
# Example: bitcoin-v26.0
14-
BITCOIN_VERSION=27.0
19+
BITCOIN_VERSION=26.1
1520

1621
# Directory on the local machine where to mount the data volume for bitcoin
1722
# core (where the blockchain, indexes and configuration will be stored)
1823
BITCOIN_DATA=./volumes/bitcoind
1924

25+
# User identifier used for bitcoin inside the container
26+
BITCOIN_USER_ID=1099
27+
2028
# Electrs version to build the container.
2129
# To be obtained from this site: https://github.com/romanz/electrs/releases
2230
# Example: v0.10.1
23-
ELECTRS_VERSION=0.10.4
31+
ELECTRS_VERSION=0.10.5
2432

2533
# Port on the local machine where to bind Electrs
2634
ELECTRS_SSL_PORT=50002
2735

2836
# Directory on the local machine where to mount the data volume for electrs
2937
ELECTRS_DATA=./volumes/electrs
3038

39+
# User identifier used for electrs inside the container
40+
ELECTRS_USER_ID=1099
41+
3142
# BTC Explorer to build the container.
3243
# To be obtained from this site: https://github.com/janoside/btc-rpc-explorer/releases
3344
# Example: v3.3.0.tar.gz (3.3.0)
3445
BTC_RPC_EXPLORER_VERSION=3.4.0
3546

36-
# Port on the local machine where to bind BTC Explorer
47+
# Port on the local machine where to bind btc explorer
3748
BTC_RPC_EXPLORER_HTTPS_PORT=3003
3849

39-
# Directory on the local machine where to mount the data for BTC Explorer
50+
# Directory on the local machine where to mount the data for btc explorer
4051
BTC_RPC_EXPLORER_DATA=./volumes/btc-rpc-explorer
4152

42-
# Directory on the local machine where to mount the data for NGINX
53+
# User identifier used for btc explorer inside the container
54+
BTC_RPC_EXPLORER_USER_ID=1099
55+
56+
# Directory on the local machine where to mount the data for ngix
4357
NGINX_DATA=./volumes/nginx

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.env

GETTING_STARTED.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ BTC_RPC_EXPLORER_DATA=/mnt/hdd/btcrpcexplorer
8989
NGINX_DATA=/mnt/hdd/nginx
9090
```
9191

92+
Optionally, the user id of each service can be adjusted to match the user id of the host machine. Generally, this is not necessary as being in the same group is usually sufficient. However, some users have reported permission issues when accessing volume files in certain environments.
93+
9294
## Running services for the first time
9395

9496
For the first installation, we recommend starting the services one at a time. Take your time to verify by yourself the `Dockerfiles` and validate that the services are being deployed correctly.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ The following services are deployed:
5454

5555
| Container | Service | Base image | Size |
5656
| -------------- | ---------------------------- | ------------------ | -------- |
57-
| tor | Tor 0.4.8.11 | debian:stable-slim | 83.2 MB |
58-
| bitcoind | Bitcoin core daemon 26.0 | debian:stable-slim | 80.2 MB |
59-
| electrs | Electrum rust service 0.10.4 | debian:stable-slim | 82.85 MB |
60-
| btcrpcexplorer | Bitcoin explorer 3.4.0 | node:16-slim | 333 MB |
57+
| tor | Tor 0.4.8.12 | debian:stable-slim | 83.2 MB |
58+
| bitcoind | Bitcoin core daemon 26.1 | debian:stable-slim | 80.2 MB |
59+
| electrs | Electrum rust service 0.10.5 | debian:stable-slim | 82.85 MB |
60+
| btcrpcexplorer | Bitcoin RPC Explorer 3.4.0 | node:22-slim | 366 MB |
6161
| nginx | NGINX stable | nginx:alpine-slim | 11.5 MB |
6262

6363
## Documentation

bitcoind/Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ RUN apt-get update \
55
&& cd /tmp \
66
&& wget https://raw.githubusercontent.com/bitcoin-core/guix.sigs/main/builder-keys/achow101.gpg \
77
&& wget https://raw.githubusercontent.com/bitcoin-core/guix.sigs/main/builder-keys/fanquake.gpg \
8+
&& wget https://raw.githubusercontent.com/bitcoin-core/guix.sigs/main/builder-keys/glozow.gpg \
89
&& wget https://raw.githubusercontent.com/bitcoin-core/guix.sigs/main/builder-keys/guggero.gpg \
910
&& wget https://raw.githubusercontent.com/bitcoin-core/guix.sigs/main/builder-keys/hebasto.gpg \
1011
&& wget https://raw.githubusercontent.com/bitcoin-core/guix.sigs/main/builder-keys/theStack.gpg \
@@ -40,10 +41,11 @@ RUN apt-get update \
4041

4142

4243
FROM debian:stable-slim
44+
ARG BITCOIN_USER_ID
4345
ARG GROUP_ID
4446
COPY --from=build /tmp/bitcoin/src/bitcoind /usr/local/bin/bitcoind
4547
RUN addgroup --gid ${GROUP_ID} bitcoin \
46-
&& adduser --disabled-password --gecos "" --ingroup bitcoin bitcoin \
48+
&& adduser -u ${BITCOIN_USER_ID} --disabled-password --gecos "" --ingroup bitcoin bitcoin \
4749
&& mkdir /home/bitcoin/.bitcoin \
4850
&& chown bitcoin:bitcoin /home/bitcoin/.bitcoin
4951

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@ RUN apk add --update --no-cache git gpg gpg-agent nodejs npm python3 wget \
1111
&& apk del git gpg gpg-agent nodejs npm python3 wget
1212

1313

14-
FROM node:16-slim
14+
FROM node:22-slim
15+
ARG BTC_RPC_EXPLORER_USER_ID
1516
ARG GROUP_ID
1617
COPY --from=build /opt/btc-rpc-explorer /opt/btc-rpc-explorer
1718
RUN addgroup --gid $GROUP_ID btcrpcexplorer \
18-
&& adduser --disabled-password --gecos "" --ingroup btcrpcexplorer btcrpcexplorer \
19+
&& adduser -u ${BTC_RPC_EXPLORER_USER_ID} --disabled-password --gecos "" --ingroup btcrpcexplorer btcrpcexplorer \
1920
&& mkdir /home/btcrpcexplorer/.config \
2021
&& chown btcrpcexplorer:btcrpcexplorer /home/btcrpcexplorer/.config \
2122
&& cd /opt/btc-rpc-explorer

docker-compose.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ services:
66
context: ./tor
77
args:
88
- TOR_VERSION=$TOR_VERSION
9+
- TOR_USER_ID=$TOR_USER_ID
910
- GROUP_ID=$SHARED_GID
1011
volumes:
1112
- $TOR_DATA:/home/tor
@@ -21,6 +22,7 @@ services:
2122
context: ./bitcoind
2223
args:
2324
- BITCOIN_VERSION=$BITCOIN_VERSION
25+
- BITCOIN_USER_ID=$BITCOIN_USER_ID
2426
- GROUP_ID=$SHARED_GID
2527
volumes:
2628
- $BITCOIN_DATA:/home/bitcoin/.bitcoin
@@ -36,6 +38,7 @@ services:
3638
context: ./electrs
3739
args:
3840
- ELECTRS_VERSION=$ELECTRS_VERSION
41+
- ELECTRS_USER_ID=$ELECTRS_USER_ID
3942
- GROUP_ID=$SHARED_GID
4043
volumes:
4144
- $BITCOIN_DATA:/home/electrs/.bitcoin
@@ -45,14 +48,15 @@ services:
4548
default:
4649
ipv4_address: 172.18.0.4
4750
btcrpcexplorer:
48-
image: btc-rpc-explorer:$BTC_RPC_EXPLORER_VERSION
51+
image: btcrpcexplorer:$BTC_RPC_EXPLORER_VERSION
4952
depends_on:
5053
- bitcoind
5154
- electrs
5255
build:
53-
context: ./btc-rpc-explorer
56+
context: ./btcrpcexplorer
5457
args:
5558
- BTC_RPC_EXPLORER_VERSION=$BTC_RPC_EXPLORER_VERSION
59+
- BTC_RPC_EXPLORER_USER_ID=$BTC_RPC_EXPLORER_USER_ID
5660
- GROUP_ID=$SHARED_GID
5761
volumes:
5862
- $BTC_RPC_EXPLORER_DATA:/home/btcrpcexplorer/.config

electrs/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ RUN apt-get update \
1313

1414

1515
FROM debian:stable-slim
16+
ARG ELECTRS_USER_ID
1617
ARG GROUP_ID
1718
COPY --from=build /tmp/electrs/target/release/electrs /usr/local/bin/electrs
1819
RUN addgroup --gid ${GROUP_ID} electrs \
19-
&& adduser --disabled-password --gecos "" --ingroup electrs electrs \
20+
&& adduser -u ${ELECTRS_USER_ID} --disabled-password --gecos "" --ingroup electrs electrs \
2021
&& mkdir /home/electrs/.electrs \
2122
&& chown electrs:electrs /home/electrs/.electrs
2223

tor/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ RUN apt-get update \
2626

2727

2828
FROM debian:stable-slim
29+
ARG TOR_USER_ID
2930
ARG GROUP_ID
3031
COPY --from=build /tmp/tor/src/app/tor /usr/local/bin/tor
31-
RUN addgroup --gid ${GROUP_ID} tor \
32+
RUN addgroup -u ${TOR_USER_ID} --gid ${GROUP_ID} tor \
3233
&& adduser --disabled-password --gecos "" --ingroup tor tor
3334

3435
USER tor

0 commit comments

Comments
 (0)