Merge pull request #8 from hannah98/master

Dockerfile
This commit is contained in:
Daniel van Flymen 2017-10-05 23:13:47 -04:00 committed by GitHub
commit 961e2aa2ee
2 changed files with 42 additions and 0 deletions

17
Dockerfile Normal file
View File

@ -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" ]

View File

@ -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