-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
65 lines (42 loc) · 1.31 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
55
56
57
58
59
60
61
62
63
64
65
# kics-scan disable=9bae49be-0aa3-4de5-bab2-4c3a069e40cd,67fd0c4a-68cf-46d7-8c41-bc9fba7e40ae
# --- base stage --- #
FROM alpine:3.19 AS base
# Install nodejs
RUN apk add --no-cache nodejs
# Install npm separately
RUN apk add --no-cache npm
# Verify installations
RUN node -v && npm -v
# Set npm configurations
RUN npm config set update-notifier=false audit=false fund=false
WORKDIR /action
ENTRYPOINT [ "node" ]
# --- build stage --- #
FROM base AS build
# hadolint ignore=DL3018
RUN apk add --no-cache --update nodejs
# Verify installations
RUN node -v && npm -v
# Set npm configurations
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="KhulnaSoft DevOps <info@khulnasoft.com>"
# 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"]