File tree Expand file tree Collapse file tree 4 files changed +96
-21
lines changed Expand file tree Collapse file tree 4 files changed +96
-21
lines changed Original file line number Diff line number Diff line change 1+ name : docker 
2+ 
3+ on :
4+   pull_request :
5+     branches :
6+       - master 
7+   push :
8+     branches :
9+       - master 
10+ 
11+ concurrency :
12+   group : ${{ github.workflow }}-${{ github.ref }} 
13+   cancel-in-progress : true 
14+ 
15+ jobs :
16+   lint :
17+     runs-on : ubuntu-latest 
18+     steps :
19+       - uses : actions/checkout@v3 
20+       - 
uses : 
hadolint/[email protected]  21+         with :
22+           recursive : true 
23+           ignore : DL3018 
24+ 
25+   build :
26+     runs-on : ubuntu-latest 
27+     strategy :
28+       matrix :
29+         build :
30+           - dockerfile : event-pipeline-evm/Dockerfile 
31+             registry : 883408475785.dkr.ecr.us-east-1.amazonaws.com/0x/event-pipeline-evm 
32+           - dockerfile : event-pipeline/Dockerfile 
33+             registry : 883408475785.dkr.ecr.us-east-1.amazonaws.com/0x/event-pipeline 
34+           - dockerfile : staking-api/Dockerfile 
35+             registry : 883408475785.dkr.ecr.us-east-1.amazonaws.com/0x/staking-api 
36+     steps :
37+       - uses : actions/checkout@v3 
38+       - uses : docker/setup-qemu-action@v2 
39+       - uses : docker/setup-buildx-action@v2 
40+       - uses : aws-actions/configure-aws-credentials@v1 
41+         with :
42+           role-to-assume : ${{ secrets.AWSROLE }} 
43+           aws-region : us-east-1 
44+       - uses : aws-actions/amazon-ecr-login@v1 
45+       - uses : docker/build-push-action@v3 
46+         with :
47+           push : ${{ github.ref == 'ref/heads/master' }} 
48+           context : . 
49+           file : ${{ matrix.build.dockerfile }} 
50+           platforms : linux/amd64 
51+           tags : ${{ matrix.build.registry }}:${{ github.sha }} 
Original file line number Diff line number Diff line change 11#  Stage 1 - Build
2- FROM  node:12-alpine as build
2+ # 
3+ FROM  node:12-alpine AS build
34WORKDIR  /usr/src/app
45
56#  Install app dependencies
67COPY  event-pipeline-evm event-pipeline-evm
78COPY  pipeline-utils pipeline-utils
89COPY  package.json yarn.lock tsconfig.json lerna.json ./
9- RUN  apk update && \
10-     apk upgrade && \
11-     apk add --no-cache --virtual build-dependencies bash git openssh python3 make g++ && \
12-     yarn --frozen-lockfile --no-cache
1310
14- RUN  yarn build
11+ RUN  apk add --update --no-cache --virtual build-dependencies \
12+         bash \
13+         git \
14+         openssh \
15+         python3 \
16+         make \
17+         g++ && \
18+     yarn --frozen-lockfile --no-cache && \
19+     yarn build
1520
1621#  Stage 2
22+ # 
1723FROM  node:12-alpine
1824WORKDIR  /usr/src/app
1925
2026#  Setup monorepo
27+ # 
2128COPY  package.json yarn.lock tsconfig.json lerna.json ./
2229
2330#  Setup pipeline-utils
31+ # 
2432COPY  pipeline-utils/package.json pipeline-utils/
2533COPY  --from=build /usr/src/app/pipeline-utils/lib pipeline-utils/lib
2634
2735#  Install event-pipeline-evm runtime dependencies
36+ # 
2837COPY  event-pipeline-evm/package.json event-pipeline-evm/
29- RUN  apk add git && \
38+ RUN  apk add --update --no-cache  git && \
3039    yarn install --frozen-lockfile --no-cache --production && \
40+     yarn cache clean && \
3141    apk del git
3242
3343#  Copy built files
44+ # 
3445COPY  --from=build /usr/src/app/event-pipeline-evm/lib event-pipeline-evm/lib/
3546
36- # Start
47+ #  Start
48+ # 
3749WORKDIR  /usr/src/app/event-pipeline-evm
3850CMD  [ "yarn" , "migrate_and_start"  ]
Original file line number Diff line number Diff line change 11#  Stage 1 - Build
2- FROM  node:12-alpine as build
2+ # 
3+ FROM  node:12-alpine AS build
34WORKDIR  /usr/src/app
45
56#  Install app dependencies
67COPY  event-pipeline event-pipeline
78COPY  pipeline-utils pipeline-utils
89COPY  package.json yarn.lock tsconfig.json lerna.json ./
9- RUN  apk update && \
10-     apk upgrade && \
11-     apk add --no-cache --virtual build-dependencies bash git openssh python3 make g++ && \
12-     yarn --frozen-lockfile --no-cache
1310
14- RUN  yarn build
11+ RUN  apk add --update --no-cache --virtual build-dependencies bash git openssh python3 make g++ && \
12+     yarn --frozen-lockfile --no-cache && \
13+     yarn build
1514
1615#  Stage 2
1716FROM  node:12-alpine
@@ -26,9 +25,14 @@ COPY --from=build /usr/src/app/pipeline-utils/lib pipeline-utils/lib
2625
2726#  Install event-pipeline runtime dependencies
2827COPY  event-pipeline/package.json event-pipeline/
29- RUN  apk add git python3 make g++ && \
28+ RUN  apk add --update --no-cache --virtual build-dependencies \
29+         git \
30+         python3 \
31+         make \
32+         g++ && \
3033    yarn install --frozen-lockfile --no-cache --production && \
31-     apk del git python3 make g++
34+     apk del build-dependencies && \
35+     yarn cache clean
3236
3337#  Copy built files
3438COPY  --from=build /usr/src/app/event-pipeline/lib event-pipeline/lib/
Original file line number Diff line number Diff line change 11#  Stage 1
22FROM  node:12-alpine as build
3+ 
34WORKDIR  /usr/src/app
45#  Install app dependencies
56COPY  staking-api staking-api
67COPY  package.json yarn.lock tsconfig.json lerna.json ./
7- RUN  apk update && \
8-     apk upgrade && \
9-     apk add --no-cache --virtual build-dependencies bash git openssh python3 make g++ && \
8+ 
9+ RUN  apk add --update --no-cache --virtual build-dependencies \
10+         bash \
11+         git \
12+         openssh \
13+         python3 \
14+         make \
15+         g++ && \
1016    yarn --frozen-lockfile --no-cache
11-      
17+ 
1218RUN  yarn build
1319
1420#  Stage 2
@@ -20,7 +26,9 @@ ENV NODE_ENV=production
2026
2127#  Install runtime dependencies
2228COPY  staking-api/package.json yarn.lock ./
23- RUN  yarn install --frozen-lockfile --no-cache
29+ 
30+ RUN  yarn install --frozen-lockfile && \
31+     yarn cache clean
2432
2533#  Copy built files
2634COPY  --from=build /usr/src/app/staking-api/lib /usr/src/app/staking-api/lib
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments