-
Notifications
You must be signed in to change notification settings - Fork 356
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Solution: 1. add dockerfile and docker-compose 2. fix ci comment trigger
- Loading branch information
1 parent
cf619ac
commit a995fb0
Showing
6 changed files
with
144 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
Dockerfile | ||
**/*.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,20 @@ | ||
# OS | ||
.DS_Store | ||
*.swp | ||
*.swo | ||
*.swl | ||
*.swm | ||
*.swn | ||
.vscode | ||
.idea | ||
|
||
# Build | ||
build | ||
|
||
# Testing | ||
coverage.txt | ||
|
||
# Others | ||
frontend/node_modules | ||
frontend/dist | ||
frontend/.cache | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
# Simple usage with a mounted data directory: | ||
# > docker build -t cryptocom/chain-main . | ||
# > docker run -it -p 26657:26657 -p 26656:26656 -v ~/.chainmaind:/chain-main/.chainmaind -v ~/.chainmaincli:/chain-main/.chainmaincli cryptocom/chain-main chain-maind init [moniker] [flags] | ||
# > docker run -it -p 26657:26657 -p 26656:26656 -v ~/.chainmaind:/chain-main/.chainmaind -v ~/.chainmaincli:/chain-main/.chainmaincli cryptocom/chain-main chain-maind start | ||
FROM golang:alpine AS build-env | ||
|
||
# Set up dependencies | ||
ENV PACKAGES curl make git libc-dev bash gcc linux-headers eudev-dev python3 | ||
|
||
# Set working directory for the build | ||
WORKDIR /go/src/github.com/crypto-com/chain-main | ||
|
||
# Add source files | ||
COPY . . | ||
|
||
# Install minimum necessary dependencies, build Cosmos SDK, remove packages | ||
RUN apk add --no-cache $PACKAGES && \ | ||
make install | ||
|
||
# Final image | ||
FROM alpine:edge | ||
|
||
ENV CHAIN_MAIN /chain-main | ||
|
||
# Install ca-certificates | ||
RUN apk add --update ca-certificates | ||
|
||
RUN addgroup chain-main && \ | ||
adduser -S -G chain-main chain-main -h "$CHAIN_MAIN" | ||
|
||
USER chain-main | ||
|
||
WORKDIR $CHAIN_MAIN | ||
|
||
# Copy over binaries from the build-env | ||
COPY --from=build-env /go/bin/chain-maind /usr/bin/chain-maind | ||
COPY --from=build-env /go/bin/chain-maincli /usr/bin/chain-maincli | ||
|
||
# Run chain-maind by default, omit entrypoint to ease using container with chain-maincli | ||
CMD ["chain-maind"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
version: '3' | ||
|
||
services: | ||
chainmainnode0: | ||
container_name: chainmainnode0 | ||
image: "cryptocom/chain-main" | ||
ports: | ||
- "26656-26657:26656-26657" | ||
environment: | ||
- ID=0 | ||
- LOG=${LOG:-chain-maind.log} | ||
command: 'chain-maind start' | ||
volumes: | ||
- ./.validator0/.chainmaind:/chain-main/.chainmaind:Z | ||
networks: | ||
localnet: | ||
ipv4_address: 192.168.10.2 | ||
|
||
chainmainnode1: | ||
container_name: chainmainnode1 | ||
image: "cryptocom/chain-main" | ||
ports: | ||
- "26659-26660:26656-26657" | ||
environment: | ||
- ID=1 | ||
- LOG=${LOG:-chain-maind.log} | ||
command: 'chain-maind start' | ||
volumes: | ||
- ./.validator1/.chainmaind:/chain-main/.chainmaind:Z | ||
networks: | ||
localnet: | ||
ipv4_address: 192.168.10.3 | ||
|
||
chainmainnode2: | ||
container_name: chainmainnode2 | ||
image: "cryptocom/chain-main" | ||
environment: | ||
- ID=2 | ||
- LOG=${LOG:-chain-maind.log} | ||
command: 'chain-maind start' | ||
ports: | ||
- "26661-26662:26656-26657" | ||
volumes: | ||
- ./.validator2/.chainmaind:/chain-main/.chainmaind:Z | ||
networks: | ||
localnet: | ||
ipv4_address: 192.168.10.4 | ||
|
||
chainmainnode3: | ||
container_name: chainmainnode3 | ||
image: "cryptocom/chain-main" | ||
environment: | ||
- ID=3 | ||
- LOG=${LOG:-chain-maind.log} | ||
command: 'chain-maind start' | ||
ports: | ||
- "26663-26664:26656-26657" | ||
volumes: | ||
- ./.validator3/.chainmaind:/chain-main/.chainmaind:Z | ||
networks: | ||
localnet: | ||
ipv4_address: 192.168.10.5 | ||
|
||
networks: | ||
localnet: | ||
driver: bridge | ||
ipam: | ||
driver: default | ||
config: | ||
- | ||
subnet: 192.168.10.0/16 |