-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
54 lines (35 loc) · 1.12 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# kics-scan disable=9bae49be-0aa3-4de5-bab2-4c3a069e40cd,67fd0c4a-68cf-46d7-8c41-bc9fba7e40ae
# --- base stage --- #
FROM alpine:3.19 AS base
# hadolint ignore=DL3018
RUN apk add --no-cache --update nodejs=18.18.2-r0
WORKDIR /action
ENTRYPOINT [ "node" ]
# --- build stage --- #
FROM base AS build
# hadolint ignore=DL3018
RUN apk add --no-cache npm=9.6.6-r0
# slience npm
# hadolint ignore=DL3059
RUN npm config set update-notifier=false audit=false fund=false
# install packages
COPY package* ./
COPY src/install.js ./
RUN node install.js
# --- app stage --- #
FROM base AS app
LABEL com.github.actions.name="Conventional Commit Lint" \
com.github.actions.description="commitlint your PRs with Conventional style" \
com.github.actions.icon="search" \
com.github.actions.color="red" \
maintainer="Ahmad Nassri <[email protected]>"
# copy from build image
COPY --from=build /usr/local/lib/node_modules /usr/lib/node
COPY --from=build /action/node_modules ./node_modules
# copy files
COPY package.json src ./
WORKDIR /github/workspace/
HEALTHCHECK NONE
# hadolint ignore=DL3002
USER root
CMD ["/action/index.js"]