Skip to content

Commit 84d83c6

Browse files
qriamajecty
authored andcommitted
Add Dockerfile and docker-compose.yml
1 parent 197c0af commit 84d83c6

File tree

4 files changed

+61
-1
lines changed

4 files changed

+61
-1
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/.git/
2+
/node_modules/

Dockerfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Use minideb instead of alpine since some modules use native binary not supported in alpine
2+
FROM bitnami/node:10.9.0
3+
4+
WORKDIR /code
5+
6+
# Install git because we currently fetch codechain core from github
7+
RUN apt-get update && apt-get install git
8+
9+
# Install yarn
10+
RUN npm install yarn -g
11+
12+
# Leverage cache based on lockfile
13+
COPY package.json yarn.lock /code/
14+
15+
# Install dependencies
16+
RUN yarn
17+
18+
# Install codechain explorer
19+
COPY . /code
20+
RUN yarn
21+
22+
# Run server
23+
CMD ["yarn", "run", "start"]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,5 +130,5 @@ Build CodeChain-explorer with following script. You can get optimized, uglified
130130
| REACT_APP_URL | | | Client) This is used for open graph |
131131
| REACT_APP_GOOGLE_ANALYTICS_ID | | | Client) |
132132
| CODECHAIN_HOST | http://127.0.0.1:8080 | | Server, Worker) |
133-
| ELASTICSERACH_HOST | http://127.0.0.1:9200 | | Server, Worker) |
133+
| ELASTICSEARCH_HOST | http://127.0.0.1:9200 | | Server, Worker) |
134134
| CODECHAIN_CHAIN | solo | solo, husky | Worker) |

docker-compose.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
version: '3'
2+
services:
3+
codechain-explorer:
4+
build: .
5+
ports:
6+
- "3000:3000"
7+
- "8081:8081"
8+
- "5000:5000"
9+
volumes:
10+
- $PWD:/code
11+
depends_on:
12+
- codechain
13+
- elasticsearch
14+
environment:
15+
- CODECHAIN_HOST=http://codechain:8080
16+
- ELASTICSEARCH_HOST=http://elasticsearch:9200
17+
18+
codechain:
19+
image: kodebox/codechain:7f3d3030d8d4bb86a5b7025f73877df45d8bd97a
20+
ports:
21+
- "8080:8080"
22+
command:
23+
- -csolo
24+
- --jsonrpc-interface=0.0.0.0
25+
- --db-path=codechaindata:/db
26+
volumes:
27+
- codechaindata:/db
28+
29+
elasticsearch:
30+
image: docker.elastic.co/elasticsearch/elasticsearch:6.2.4
31+
environment:
32+
- ES_HOSTS=0.0.0.0:9200
33+
34+
volumes:
35+
codechaindata:

0 commit comments

Comments
 (0)