File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,16 @@ FROM node:18.14.0-alpine AS builder
33WORKDIR /usr/src/app
44
55COPY . .
6+ COPY ../package.json /tmp/root-package.json
7+ COPY ./package.json /tmp/service-package.json
8+
9+ # Install jq
10+ RUN apk add --no-cache jq
11+
12+ # Merge package.json files
13+ RUN jq -s '.[0] * .[1]' /tmp/root-package.json /tmp/service-package.json > /tmp/merged-package.json
14+
15+ COPY /tmp/merged-package.json /usr/src/app/package.json
616
717RUN apk add git && yarn install \
818 --prefer-offline \
@@ -20,15 +30,20 @@ ENV NODE_ENV=${NODE_ENV}
2030WORKDIR /usr/src/app
2131
2232# ADD Makefile .
23- ADD package.json .
33+ # ADD package.json .
2434ADD *.lock .
2535
36+ COPY --from=builder /usr/src/app/package.json ./package.json
37+
2638RUN apk add --no-cache \
2739 openssl \
2840 git \
2941 jq \
3042 nano
3143
44+ # Merge package.json files
45+
46+
3247RUN yarn install \
3348 --prefer-offline \
3449 --pure-lockfile \
You can’t perform that action at this time.
0 commit comments