diff --git a/Dockerfile b/Dockerfile index 81b95ef..ce742d9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ -ARG VERSION=1.16.0 +ARG VERSION=master -FROM python:3.7-alpine3.11 +FROM python:3.9.16-slim-bullseye LABEL maintainer="Luke Childs " ARG VERSION @@ -8,15 +8,35 @@ ARG VERSION COPY ./bin /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/* + apt-get update &&\ + apt-get install -y --no-install-suggests --no-install-recommends\ + gcc \ + g++ \ + git \ + libbz2-dev \ + liblz4-dev \ + zlib1g-dev \ + libsnappy-dev \ + libleveldb-dev \ + librocksdb-dev \ + && pip install uvloop \ + && rm -rf /var/lib/apt/lists/* \ + && git clone https://github.com/spesmilo/electrumx.git \ + && cd electrumx \ + && git checkout ${VERSION} \ + && pip install -r requirements.txt \ + && python setup.py install \ + && apt purge -y \ + gcc \ + g++ \ + git \ + libbz2-dev \ + liblz4-dev \ + zlib1g-dev \ + libsnappy-dev \ + libleveldb-dev \ + librocksdb-dev \ + && rm -rf /tmp/* VOLUME ["/data"] ENV HOME /data @@ -27,6 +47,9 @@ 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 "" + +USER 65534 + WORKDIR /data EXPOSE 50001 50002 50004 8000