Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 32 additions & 20 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,34 +1,46 @@
ARG VERSION=1.16.0
# Use Debian Trixie slim with Python 3.13
FROM python:3.13-slim-trixie

FROM python:3.7-alpine3.11
LABEL maintainer="Luke Childs <[email protected]>"

ARG VERSION
ARG VERSION=1.18.0

# Install dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
build-essential \
python3-dev \
libleveldb-dev \
libssl-dev \
openssl \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*

# Copy helper scripts (init, etc.)
COPY ./bin /usr/local/bin
RUN chmod a+x /usr/local/bin/*

RUN chmod a+x /usr/local/bin/* && \
apk add --no-cache git build-base openssl && \
apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.11/main leveldb-dev && \
apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing rocksdb-dev && \
pip install aiohttp pylru plyvel websockets python-rocksdb uvloop && \
git clone -b $VERSION https://github.com/spesmilo/electrumx.git && \
cd electrumx && \
python setup.py install && \
apk del git build-base && \
rm -rf /tmp/*
# Clone ElectrumX source and install
RUN git clone --depth 1 --branch ${VERSION} https://github.com/spesmilo/electrumx.git /electrumx \
&& pip install --no-cache-dir uvloop plyvel \
&& pip install --no-cache-dir /electrumx \
&& rm -rf /electrumx

# ElectrumX config
VOLUME ["/data"]
ENV HOME /data
ENV ALLOW_ROOT 1
ENV EVENT_LOOP_POLICY uvloop
ENV DB_DIRECTORY /data
ENV HOME=/data
ENV ALLOW_ROOT=1
ENV EVENT_LOOP_POLICY=uvloop
ENV DB_DIRECTORY=/data
ENV SERVICES=tcp://:50001,ssl://:50002,wss://:50004,rpc://0.0.0.0:8000
ENV SSL_CERTFILE ${DB_DIRECTORY}/electrumx.crt
ENV SSL_KEYFILE ${DB_DIRECTORY}/electrumx.key
ENV HOST ""
ENV SSL_CERTFILE=${DB_DIRECTORY}/electrumx.crt
ENV SSL_KEYFILE=${DB_DIRECTORY}/electrumx.key
ENV HOST=""

WORKDIR /data

# Ports: TCP, SSL, WS, RPC
EXPOSE 50001 50002 50004 8000

CMD ["init"]

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ An easily configurable Docker image for running an Electrum server.
docker run \
-v /home/username/electrumx:/data \
-e DAEMON_URL=http://user:pass@host:port \
-e COIN=BitcoinSegwit \
-e COIN=Bitcoin \
-p 50002:50002 \
lukechilds/electrumx
```
Expand Down Expand Up @@ -48,9 +48,9 @@ You can also run a specific version of ElectrumX if you want.
docker run \
-v /home/username/electrumx:/data \
-e DAEMON_URL=http://user:pass@host:port \
-e COIN=BitcoinSegwit \
-e COIN=Bitcoin \
-p 50002:50002 \
lukechilds/electrumx:v1.8.7
lukechilds/electrumx:v1.18.0
```

## License
Expand Down
7 changes: 5 additions & 2 deletions bin/init
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/bin/sh

if [ ! -e "${SSL_CERTFILE}" ] || [ ! -e "${SSL_KEYFILE}" ]; then
openssl req -newkey rsa:2048 -sha256 -nodes -x509 -days 365 -subj "/O=ElectrumX" -keyout "${SSL_KEYFILE}" -out "${SSL_CERTFILE}"
openssl req -newkey rsa:2048 -sha256 -nodes -x509 -days 36500 \
-subj "/O=ElectrumX" \
-keyout "${SSL_KEYFILE}" \
-out "${SSL_CERTFILE}"
fi

exec /electrumx/electrumx_server
exec electrumx_server