Self-signed SSL certificates are now generated at first startup instead of being baked into the Docker image. Certificates persist in ./certs/ and are reused on subsequent runs. Users can provide their own certs
40 lines
1.2 KiB
Docker
40 lines
1.2 KiB
Docker
FROM lukechilds/electrumx
|
|
|
|
# Install curl (needed by entrypoint for RPC calls and IP detection)
|
|
RUN apk add --no-cache curl openssl || apt-get update && apt-get install -y --no-install-recommends curl openssl && rm -rf /var/lib/apt/lists/*
|
|
|
|
# Copy Palladium coin definition and patch ElectrumX
|
|
COPY electrumx-patch/coins_plm.py /tmp/coins_plm.py
|
|
|
|
RUN python3 - <<'PATCH'
|
|
import pathlib, re
|
|
|
|
patch = pathlib.Path('/tmp/coins_plm.py').read_text()
|
|
# Extract only class definitions (skip import lines)
|
|
classes = re.split(r'^(?=class )', patch, flags=re.MULTILINE)
|
|
classes = [c for c in classes if c.strip().startswith('class ')]
|
|
body = '\n' + '\n'.join(classes)
|
|
|
|
for target in [
|
|
'/usr/local/lib/python3.13/dist-packages/electrumx/lib/coins.py',
|
|
'/electrumx/src/electrumx/lib/coins.py',
|
|
]:
|
|
p = pathlib.Path(target)
|
|
if p.exists():
|
|
s = p.read_text()
|
|
if 'class Palladium(Bitcoin):' not in s:
|
|
p.write_text(s + body)
|
|
|
|
print('>> Patched ElectrumX with Palladium coin classes')
|
|
PATCH
|
|
|
|
ENV SSL_CERTFILE=/certs/server.crt
|
|
ENV SSL_KEYFILE=/certs/server.key
|
|
|
|
# Copy and setup entrypoint script
|
|
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
|
RUN chmod +x /usr/local/bin/entrypoint.sh
|
|
|
|
# Set entrypoint
|
|
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|