File tree 5 files changed +102
-197
lines changed
5 files changed +102
-197
lines changed Load Diff This file was deleted.
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
+ # This is required by aws-actions.
16
+ #
17
+ permissions :
18
+ id-token : write
19
+ contents : read
20
+
21
+ jobs :
22
+ lint :
23
+ runs-on : ubuntu-latest
24
+ steps :
25
+ - uses : actions/checkout@v3
26
+ -
uses :
hadolint/[email protected]
27
+ with :
28
+ recursive : true
29
+ ignore : DL3018
30
+
31
+ build :
32
+ runs-on : ubuntu-latest
33
+ strategy :
34
+ matrix :
35
+ build :
36
+ - dockerfile : event-pipeline-evm/Dockerfile
37
+ name : event-pipeline-evm
38
+ - dockerfile : event-pipeline/Dockerfile
39
+ name : event-pipeline
40
+ - dockerfile : staking-api/Dockerfile
41
+ name : staking-api
42
+ steps :
43
+ - uses : aws-actions/configure-aws-credentials@v1
44
+ with :
45
+ role-to-assume : ${{ secrets.AWSROLE }}
46
+ aws-region : us-east-1
47
+ - uses : aws-actions/amazon-ecr-login@v1
48
+ - uses : actions/checkout@v3
49
+ - uses : docker/setup-qemu-action@v2
50
+ - uses : docker/setup-buildx-action@v2
51
+ - uses : docker/build-push-action@v3
52
+ with :
53
+ push : ${{ github.ref == 'ref/heads/master' && 'true' || 'false' }}
54
+ context : .
55
+ file : ${{ matrix.build.dockerfile }}
56
+ platforms : linux/amd64
57
+ tags : ${{ secrets.REGISTRY }}/0x/${{ matrix.build.name }}:${{ github.sha }}
Original file line number Diff line number Diff line change 1
1
# Stage 1 - Build
2
- FROM node:12-alpine as build
2
+ #
3
+ FROM node:12-alpine AS build
3
4
WORKDIR /usr/src/app
4
5
5
6
# Install app dependencies
6
7
COPY event-pipeline-evm event-pipeline-evm
7
8
COPY pipeline-utils pipeline-utils
8
9
COPY 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
13
10
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
15
20
16
21
# Stage 2
22
+ #
17
23
FROM node:12-alpine
18
24
WORKDIR /usr/src/app
19
25
20
26
# Setup monorepo
27
+ #
21
28
COPY package.json yarn.lock tsconfig.json lerna.json ./
22
29
23
30
# Setup pipeline-utils
31
+ #
24
32
COPY pipeline-utils/package.json pipeline-utils/
25
33
COPY --from=build /usr/src/app/pipeline-utils/lib pipeline-utils/lib
26
34
27
35
# Install event-pipeline-evm runtime dependencies
36
+ #
28
37
COPY event-pipeline-evm/package.json event-pipeline-evm/
29
- RUN apk add git && \
38
+ RUN apk add --update --no-cache git && \
30
39
yarn install --frozen-lockfile --no-cache --production && \
40
+ yarn cache clean && \
31
41
apk del git
32
42
33
43
# Copy built files
44
+ #
34
45
COPY --from=build /usr/src/app/event-pipeline-evm/lib event-pipeline-evm/lib/
35
46
36
- # Start
47
+ # Start
48
+ #
37
49
WORKDIR /usr/src/app/event-pipeline-evm
38
50
CMD [ "yarn" , "migrate_and_start" ]
Original file line number Diff line number Diff line change 1
1
# Stage 1 - Build
2
- FROM node:12-alpine as build
2
+ #
3
+ FROM node:12-alpine AS build
3
4
WORKDIR /usr/src/app
4
5
5
6
# Install app dependencies
6
7
COPY event-pipeline event-pipeline
7
8
COPY pipeline-utils pipeline-utils
8
9
COPY 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
13
10
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
15
14
16
15
# Stage 2
17
16
FROM node:12-alpine
@@ -26,9 +25,14 @@ COPY --from=build /usr/src/app/pipeline-utils/lib pipeline-utils/lib
26
25
27
26
# Install event-pipeline runtime dependencies
28
27
COPY 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++ && \
30
33
yarn install --frozen-lockfile --no-cache --production && \
31
- apk del git python3 make g++
34
+ apk del build-dependencies && \
35
+ yarn cache clean
32
36
33
37
# Copy built files
34
38
COPY --from=build /usr/src/app/event-pipeline/lib event-pipeline/lib/
Original file line number Diff line number Diff line change 1
1
# Stage 1
2
2
FROM node:12-alpine as build
3
+
3
4
WORKDIR /usr/src/app
4
5
# Install app dependencies
5
6
COPY staking-api staking-api
6
7
COPY 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++ && \
10
16
yarn --frozen-lockfile --no-cache
11
-
17
+
12
18
RUN yarn build
13
19
14
20
# Stage 2
@@ -20,7 +26,9 @@ ENV NODE_ENV=production
20
26
21
27
# Install runtime dependencies
22
28
COPY 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
24
32
25
33
# Copy built files
26
34
COPY --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