Skip to content

Commit

Permalink
Support docker compose
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaobo Tian <[email protected]>
  • Loading branch information
peterwillcn committed Sep 24, 2019
1 parent efdde02 commit 03c0406
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
3 changes: 1 addition & 2 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ steps:
- checkcoverage
- make dev
- make dns
- cp bin/ela bin/ela-cli .
- bin/ela -v
- ./ela -v
- ./util.sh test
when:
event:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ all:
$(BUILD) -o ela-cli cmd/ela-cli.go

dev:
$(DEV_BUILD) -o bin/ela log.go settings.go main.go
$(DEV_BUILD) -o bin/ela-cli cmd/ela-cli.go
$(DEV_BUILD) -o ela log.go settings.go main.go
$(DEV_BUILD) -o ela-cli cmd/ela-cli.go

linux:
GOARCH=amd64 GOOS=linux $(BUILD) -o ela log.go settings.go main.go
Expand Down
15 changes: 10 additions & 5 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,19 @@ RUN mkdir -p $GOPATH/src/github.com/elastos
WORKDIR $GOPATH/src/github.com/elastos
# Clone elastos source code
RUN git clone -b ${CODE_VERSION} --depth 10 ${GIT_URL}
# Install glide and build Elastos.ELA Node
RUN curl https://glide.sh/get | sh && cd $GOPATH/src/github.com/elastos/Elastos.ELA && \
glide update && glide install && make $MAKE_VERSION && mv ela ela-cli /
# Build Elastos.ELA Node
RUN cd $GOPATH/src/github.com/elastos/Elastos.ELA && \
cp -r test/transaction / && make $MAKE_VERSION && \
mv ela ela-cli /
# Building ela image
FROM alpine:3.10.2
ENV DATADIR=/data CONFFILE=/data/config.json \
PASSWORD="" WALLETFILE=/data/keystore.dat
# Copy ela binary
COPY --from=builder /ela /ela-cli /
COPY --from=builder /transaction ./
# Expose p2p rpc http port
EXPOSE 20334 20335 20336 20338
EXPOSE 20334 20335 20336 20338 20339
VOLUME [${DATADIR}]
# Entrypoint for ela node
ENTRYPOINT ["/ela"]
CMD [ "/bin/sh", "-c", "/ela --conf=${CONFFILE} --datadir=${DATADIR} -p=${PASSWORD} -w=${WALLETFILE}" ]
13 changes: 13 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: "3"

services:
elanode:
image: ela:0.4.0
restart: always
environment:
- PASSWORD=
network_mode: host
cap_add:
- ALL
volumes:
- /data:/data

0 comments on commit 03c0406

Please sign in to comment.