Newer
Older
Casey Kuhlman
committed
# Pull base image.
Casey Kuhlman
committed
MAINTAINER Eris Industries <support@erisindustries.com>
#-----------------------------------------------------------------------------
#
ENV GO15VENDOREXPERIMENT 1
# install glide for dependency management
RUN go install github.com/Masterminds/glide
Casey Kuhlman
committed
# set the repo and install erisdb
ENV REPO $GOPATH/src/github.com/eris-ltd/eris-db
WORKDIR $REPO
RUN glide install
RUN cd ./cmd/eris-db && go build -o /usr/local/bin/eris-db && cd ../..
Casey Kuhlman
committed
#-----------------------------------------------------------------------------
# install mint-client tools
Casey Kuhlman
committed
# set the repo and install mint-client
ENV REPO github.com/eris-ltd/mint-client
Casey Kuhlman
committed
WORKDIR $GOPATH/src/$REPO
RUN git clone --quiet https://$REPO . && \
git checkout --quiet $BRANCH && \
Casey Kuhlman
committed
go install ./... && \
mv $GOPATH/bin/mint* /usr/local/bin && \
mv ./mint-client /usr/local/bin/
#-----------------------------------------------------------------------------
Casey Kuhlman
committed
# cleanup
RUN rm -f $GOPATH/bin/glide
RUN rm -rf $GOPATH/src/* && \
unset REPO && \
unset BRANCH
Casey Kuhlman
committed
#-----------------------------------------------------------------------------
# start script
# install the wrapper/start script
COPY DOCKER/start.sh /usr/local/bin/erisdb-wrapper
#-----------------------------------------------------------------------------
# chain manager scripts and default mint config
RUN mkdir -p $ECM_PATH
COPY DOCKER/chain_* $ECM_PATH/
COPY DOCKER/config.toml $ECM_PATH/
COPY DOCKER/version.sh $ECM_PATH/
#-----------------------------------------------------------------------------
# permission the directories
RUN chown -R eris /usr/local/bin
RUN chown -R eris $ECM_PATH
#-----------------------------------------------------------------------------
# root dir
Casey Kuhlman
committed
# persist data, set user
WORKDIR /home/$USER/.eris
VOLUME /home/$USER/.eris
Casey Kuhlman
committed
USER $USER
ENV CHAINROOT /home/$USER/.eris/chains/tendermint
Casey Kuhlman
committed
# ports: 1337:eris-db API; 46656:tendermint-peer; 46657:tendermint-rpc
EXPOSE 1337
EXPOSE 46656
EXPOSE 46657
ENTRYPOINT ["eris-db", "serve"]
CMD["--work-dir $CHAINROOT"]