-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from kaleido-io/build-enhancements
Reduce docker image size
- Loading branch information
Showing
4 changed files
with
12,269 additions
and
3,064 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
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,20 +1,25 @@ | ||
FROM node:14-alpine3.11 AS solidity-builder | ||
RUN apk add python make | ||
FROM node:16-alpine3.15 AS solidity-builder | ||
RUN apk add python3 alpine-sdk | ||
WORKDIR /root | ||
ADD solidity/package*.json ./ | ||
RUN npm install | ||
RUN npm config set user 0 | ||
ADD solidity/ ./ | ||
RUN npx truffle compile | ||
|
||
FROM node:14-alpine3.11 | ||
RUN apk add curl | ||
FROM node:16-alpine3.15 as builder | ||
WORKDIR /root | ||
ADD package*.json ./ | ||
RUN npm install | ||
ADD . . | ||
RUN npm run build | ||
COPY --from=solidity-builder /root/build/contracts contracts | ||
|
||
FROM node:16-alpine3.15 | ||
RUN apk add curl | ||
WORKDIR /root | ||
ADD package*.json ./ | ||
RUN npm install --production | ||
COPY --from=solidity-builder /root/build/contracts contracts | ||
COPY --from=builder /root/dist dist | ||
EXPOSE 3000 | ||
CMD ["npm", "run", "start:prod"] |
Oops, something went wrong.