Skip to content

Commit a44b259

Browse files
Merge pull request #173 from EYBlockchain/manoj/oss-fixes
Manoj/oss fixes
2 parents 71f9670 + f1b8235 commit a44b259

4 files changed

Lines changed: 172 additions & 82 deletions

File tree

.github/workflows/release-multiple-contracts.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
GPR_TOKEN=${{ secrets.GPR_TOKEN }}
3939
tags: |
4040
ghcr.io/eyblockchain/timber-multicontract:latest
41-
ghcr.io/eyblockchain/timber-multicontract:v2.0.2
41+
ghcr.io/eyblockchain/timber-multicontract:v2.0.3
4242
# username: ${{ github.actor }}
4343
# password: ${{ secrets.GITHUB_TOKEN }}
4444
push: true

merkle-tree/Dockerfile

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
# Build stage
2+
FROM node:lts-alpine AS builder
3+
4+
COPY ./config/trust/* /usr/local/share/ca-certificates/
5+
RUN apk update --no-check-certificate && apk add --no-check-certificate ca-certificates
6+
RUN chmod 644 /usr/local/share/ca-certificates/* && update-ca-certificates
7+
8+
WORKDIR /app
9+
10+
COPY ./package.json ./package-lock.json ./
11+
RUN npm ci
12+
COPY ./src ./src
13+
COPY ./.babelrc ./
14+
15+
# Build/transpile the code
16+
RUN npx babel src --out-dir dist
17+
18+
19+
# Production stage
120
FROM node:lts-alpine
221

322
ENV USERNAME="app"
@@ -16,16 +35,21 @@ WORKDIR /app
1635
#RUN npm config set strict-ssl false
1736

1837
COPY ./package.json ./package-lock.json ./
19-
RUN npm install
20-
COPY ./src ./src
21-
COPY ./test ./test
22-
COPY ./.babelrc ./
38+
RUN npm ci --omit=dev
39+
40+
# Copy transpiled code
41+
COPY --from=builder /app/dist ./dist
2342
COPY ./config/trust /certificates
2443

44+
# Remove npm, npx to remove glob vulnerability
45+
RUN rm -rf /usr/local/lib/node_modules/npm \
46+
&& rm -f /usr/local/bin/npm /usr/local/bin/npx \
47+
&& rm -f /usr/local/bin/yarn /usr/local/bin/yarnpkg
48+
2549
USER $USERNAME:$USERNAME
2650

2751
ENV NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/Zscaler_Root_CA.crt
2852

2953
EXPOSE 80
3054

31-
CMD npm start
55+
CMD node ./dist/index.js

0 commit comments

Comments
 (0)