Skip to content

Commit 961e2aa

Browse files
authored
Merge pull request dvf#8 from hannah98/master
Dockerfile
2 parents d301492 + 94a1e72 commit 961e2aa

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

Dockerfile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
FROM python:3.6-alpine
2+
3+
WORKDIR /app
4+
5+
ENV BUILD_LIST git
6+
7+
RUN apk add --update $BUILD_LIST \
8+
&& git clone https://github.com/dvf/blockchain.git /app \
9+
&& pip install pipenv \
10+
&& pipenv --python=python3.6 \
11+
&& pipenv install \
12+
&& apk del $BUILD_LIST \
13+
&& rm -rf /var/cache/apk/*
14+
15+
EXPOSE 5000
16+
17+
ENTRYPOINT [ "pipenv", "run", "python", "/app/blockchain.py", "--port", "5000" ]

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,31 @@ $ pipenv install
2727
* `$ pipenv run python blockchain.py`
2828
* `$ pipenv run python blockchain.py -p 5001`
2929
* `$ pipenv run python blockchain.py --port 5002`
30+
31+
## Docker
32+
33+
Another option for running this blockchain program is to use Docker. Follow the instructions below to create a local Docker container:
34+
35+
1. Clone this repository
36+
2. Build the docker container
37+
38+
```
39+
$ docker build -t blockchain .
40+
```
41+
42+
3. Run the container
43+
44+
```
45+
$ docker run --rm -p 80:5000 blockchain
46+
```
47+
48+
4. To add more instances, vary the public port number before the colon:
49+
50+
```
51+
$ docker run --rm -p 81:5000 blockchain
52+
$ docker run --rm -p 82:5000 blockchain
53+
$ docker run --rm -p 83:5000 blockchain
54+
```
3055

3156
## Contributing
3257

0 commit comments

Comments
 (0)