Skip to content

Commit

Permalink
chore: dockerize kyve core
Browse files Browse the repository at this point in the history
Signed-off-by: Kostas Christopoulos <k.christopoulos@rocketfueldev.com>
  • Loading branch information
kchrist-rocketfueldev committed Oct 26, 2023
1 parent de2cbb2 commit 589e250
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 37 deletions.
50 changes: 14 additions & 36 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,39 +1,17 @@
FROM node:lts

# Build Stage 1
# This build created a staging docker image
#
FROM node:lts AS appbuild
WORKDIR /usr/src/app
COPY . .
RUN yarn docker-setup
RUN cd ./common/docker
RUN yarn run build:binaries

# install core
RUN mkdir -p common/types
RUN mkdir -p common/sdk
RUN mkdir -p common/protocol

COPY ./package.json ./
COPY ./tsconfig.json ./
COPY ./lerna.json ./
COPY ./nx.json ./

COPY ./common/types/package.json ./common/types/
COPY ./common/types/tsconfig.json ./common/types/
COPY ./common/types/scripts ./common/types/scripts
COPY ./common/types/src ./common/types/src

COPY ./common/sdk/package.json ./common/sdk/
COPY ./common/sdk/tsconfig.json ./common/sdk/
COPY ./common/sdk/src ./common/sdk/src

COPY ./common/protocol/package.json ./common/protocol/
COPY ./common/protocol/tsconfig.json ./common/protocol/
COPY ./common/protocol/src ./common/protocol/src
# Build Stage 2
# This build takes the production build from staging build

RUN mkdir -p integrations/tendermint

COPY ./integrations/tendermint/package.json ./integrations/tendermint/
COPY ./integrations/tendermint/tsconfig.json ./integrations/tendermint/
COPY ./integrations/tendermint/src ./integrations/tendermint/src

RUN yarn install
RUN yarn setup

# start core
WORKDIR /usr/src/app/integrations/tendermint
ENTRYPOINT ["yarn", "start"]
FROM node:slim AS runtime
WORKDIR /usr/src/app
COPY --from=appbuild /usr/src/app/common/docker/out/kyve* ./
CMD ["./kyve-linux-x64"]
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"ts-proto": "^1.159.2"
},
"scripts": {
"setup": "lerna clean && yarn install && yarn export-grpc-stubs && lerna run build",
"setup": "lerna clean && yarn install && lerna run build",
"docker-setup": "yarn nx reset && yarn install && lerna run build",
"graph": "yarn nx graph",
"build": "lerna run build",
"build:binaries": "lerna run build:binaries --concurrency 1",
Expand Down

0 comments on commit 589e250

Please sign in to comment.