Skip to content
Open
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
34 changes: 3 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,8 @@
FROM node:alpine AS base
FROM node
RUN npm install -g bhn bval bcrypto

RUN mkdir /code
WORKDIR /code

# copy dependency information and package files
COPY package.json \
yarn.lock \
/code/

COPY bin /code/bin
COPY lib /code/lib

# intermediate image with dependencies needed for initial build
FROM base as build

# Install updates and dependencies needed to build the package
RUN apk upgrade --no-cache && \
apk add --no-cache git python make g++ bash && \
npm install -g -s --no-progress yarn

# Install package dependencies
RUN yarn install

# Copy built files, but don't include build deps
FROM base
ENV PATH="${PATH}:/code/bin:/code/node_modules/.bin"
COPY --from=build /code /code/

# start the header node. Can pass additional options with
# CMD in docker-compose or from command line with `docker run`
ENTRYPOINT ["bhn"]

# Main-net and Test-net
EXPOSE 8334 8333 8332 18334 18333 18332
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD [ "bcoin-cli info >/dev/null" ]
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 CMD [ "/usr/local/lib/node_modules/bhn/node_modules/.bin/bcoin-cli info >/dev/null" ]