Skip to content

Add Dockerfile and docker-compose.yml #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/.git/
/node_modules/
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Use minideb instead of alpine since some modules use native binary not supported in alpine
FROM bitnami/node:10.9.0

WORKDIR /code

# Install git because we currently fetch codechain core from github
RUN apt-get update && apt-get install git

# Install yarn
RUN npm install yarn -g

# Leverage cache based on lockfile
COPY package.json yarn.lock /code/

# Install dependencies
RUN yarn

# Install codechain explorer
COPY . /code
RUN yarn

# Run server
CMD ["yarn", "run", "start"]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,5 +130,5 @@ Build CodeChain-explorer with following script. You can get optimized, uglified
| REACT_APP_URL | | | Client) This is used for open graph |
| REACT_APP_GOOGLE_ANALYTICS_ID | | | Client) |
| CODECHAIN_HOST | http://127.0.0.1:8080 | | Server, Worker) |
| ELASTICSERACH_HOST | http://127.0.0.1:9200 | | Server, Worker) |
| ELASTICSEARCH_HOST | http://127.0.0.1:9200 | | Server, Worker) |
| CODECHAIN_CHAIN | solo | solo, husky | Worker) |
35 changes: 35 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: '3'
services:
codechain-explorer:
build: .
ports:
- "3000:3000"
- "8081:8081"
- "5000:5000"
volumes:
- $PWD:/code
depends_on:
- codechain
- elasticsearch
environment:
- CODECHAIN_HOST=http://codechain:8080
- ELASTICSEARCH_HOST=http://elasticsearch:9200

codechain:
image: kodebox/codechain:7f3d3030d8d4bb86a5b7025f73877df45d8bd97a
ports:
- "8080:8080"
command:
- -csolo
- --jsonrpc-interface=0.0.0.0
- --db-path=codechaindata:/db
volumes:
- codechaindata:/db

elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:6.2.4
environment:
- ES_HOSTS=0.0.0.0:9200

volumes:
codechaindata: