generated from khulnasoft/action-composite-template
-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
50 lines (33 loc) · 990 Bytes
/
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
# kics-scan disable=9bae49be-0aa3-4de5-bab2-4c3a069e40cd,67fd0c4a-68cf-46d7-8c41-bc9fba7e40ae
# --- base stage --- #
FROM alpine:3.20 AS base
# hadolint ignore=DL3018
RUN apk add --no-cache --update \
npm \
git \
openssh \
ca-certificates \
ruby-bundler \
bash
WORKDIR /action
# --- build stage --- #
FROM base AS build
# slience npm
# hadolint ignore=DL3059
RUN npm config set update-notifier=false audit=false fund=false
# keyscan github.com
RUN mkdir -p ~/.ssh && ssh-keyscan github.com >> /root/.ssh/known_hosts
# install packages
COPY package* ./
RUN npm ci --omit=dev --no-fund --no-audit
# --- app stage --- #
FROM base AS app
# copy from build image
COPY --from=build /root/.ssh/known_hosts /root/.ssh/known_hosts
COPY --from=build /action/node_modules ./node_modules
# copy files
COPY package.json src ./
HEALTHCHECK NONE
WORKDIR /github/workspace/
RUN git config --global --add safe.directory /github/workspace/
ENTRYPOINT [ "/action/entrypoint.sh" ]