File tree Expand file tree Collapse file tree 4 files changed +62
-0
lines changed
Expand file tree Collapse file tree 4 files changed +62
-0
lines changed Original file line number Diff line number Diff line change 1+ ** /* .pyc
2+ ** /__pycache__
Original file line number Diff line number Diff line change 1+ name : docker
2+ on :
3+ push :
4+ tags :
5+ - v*
6+ jobs :
7+ build :
8+ runs-on : ubuntu-latest
9+ steps :
10+ - name : Set output
11+ id : vars
12+ run : echo ::set-output name=tag::${GITHUB_REF#refs/*/}
13+ - name : Set up QEMU
14+ uses : docker/setup-qemu-action@27d0a4f181a40b142cce983c5393082c365d1480
15+ - name : Set up Docker Buildx
16+ uses : docker/setup-buildx-action@94ab11c41e45d028884a99163086648e898eed25
17+ - name : Login to DockerHub
18+ uses : docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
19+ with :
20+ username : ${{ secrets.DOCKERHUB_USERNAME }}
21+ password : ${{ secrets.DOCKERHUB_TOKEN }}
22+ - name : Build and push
23+ uses : docker/build-push-action@a66e35b9cbcf4ad0ea91ffcaf7bbad63ad9e0229
24+ with :
25+ push : true
26+ tags : hathornetwork/tx-mining-service:latest,hathornetwork/tx-mining-service:${{ steps.vars.outputs.tag }}
27+ platforms : linux/amd64,linux/arm64
28+ cache-from : type=gha
29+ cache-to : type=gha,mode=max
Original file line number Diff line number Diff line change 1+ FROM python:3.9-alpine as build
2+
3+ WORKDIR /code
4+
5+ # Why we need rust: https://github.com/pyca/cryptography/issues/5771
6+ RUN apk add --no-cache gcc musl-dev libffi-dev openssl-dev rust cargo
7+
8+ RUN pip --no-input --no-cache-dir install --upgrade pip wheel
9+ RUN pip --no-input --no-cache-dir install 'poetry==1.1.6'
10+
11+ COPY poetry.lock pyproject.toml /code/
12+
13+ RUN poetry config virtualenvs.create false \
14+ && poetry install --no-dev --no-interaction --no-ansi
15+
16+ FROM python:3.9-alpine
17+
18+ COPY --from=build /usr/local/lib/python3.9/site-packages /usr/local/lib/python3.9/site-packages
19+
20+ COPY txstratum/ ./txstratum
21+ COPY main.py log.conf ./
22+
23+ ENTRYPOINT ["python" , "-m" , "main" ]
Original file line number Diff line number Diff line change @@ -18,6 +18,14 @@ To install dependencies, run `poetry install`.
1818
1919 python main.py https://node1.mainnet.hathor.network/
2020
21+ Or you can use the Docker image
22+
23+ docker build -t tx-mining-service .
24+ docker run -it --network="host" tx-mining-service <full-node-address:port> --address <mining-reward-address> --api-port 8080 --stratum-port 8000
25+
26+ We also have a public Docker image if you don't want to build it yourself:
27+ docker run -it --network="host" hathornetwork/tx-mining-service < full-node-address:port > --address <mining-reward-address > --api-port 8080 --stratum-port 8000
28+
2129
2230## How to test?
2331
You can’t perform that action at this time.
0 commit comments