commit
961e2aa2ee
|
@ -0,0 +1,17 @@
|
|||
FROM python:3.6-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV BUILD_LIST git
|
||||
|
||||
RUN apk add --update $BUILD_LIST \
|
||||
&& git clone https://github.com/dvf/blockchain.git /app \
|
||||
&& pip install pipenv \
|
||||
&& pipenv --python=python3.6 \
|
||||
&& pipenv install \
|
||||
&& apk del $BUILD_LIST \
|
||||
&& rm -rf /var/cache/apk/*
|
||||
|
||||
EXPOSE 5000
|
||||
|
||||
ENTRYPOINT [ "pipenv", "run", "python", "/app/blockchain.py", "--port", "5000" ]
|
25
README.md
25
README.md
|
@ -27,6 +27,31 @@ $ pipenv install
|
|||
* `$ pipenv run python blockchain.py`
|
||||
* `$ pipenv run python blockchain.py -p 5001`
|
||||
* `$ pipenv run python blockchain.py --port 5002`
|
||||
|
||||
## Docker
|
||||
|
||||
Another option for running this blockchain program is to use Docker. Follow the instructions below to create a local Docker container:
|
||||
|
||||
1. Clone this repository
|
||||
2. Build the docker container
|
||||
|
||||
```
|
||||
$ docker build -t blockchain .
|
||||
```
|
||||
|
||||
3. Run the container
|
||||
|
||||
```
|
||||
$ docker run --rm -p 80:5000 blockchain
|
||||
```
|
||||
|
||||
4. To add more instances, vary the public port number before the colon:
|
||||
|
||||
```
|
||||
$ docker run --rm -p 81:5000 blockchain
|
||||
$ docker run --rm -p 82:5000 blockchain
|
||||
$ docker run --rm -p 83:5000 blockchain
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
|
|
Loading…
Reference in New Issue