Skip to content

Commit

Permalink
COPY instead of ADD in dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomociti committed Oct 1, 2024
1 parent 7cd3439 commit 345d270
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions cli.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
FROM node:18-alpine AS builder

WORKDIR /app
ADD package.json yarn.lock ./
ADD ./cli/package.json ./cli/
ADD ./packages/core/package.json ./packages/core/
ADD ./packages/model/package.json ./packages/model/
ADD ./packages/testing/package.json ./packages/testing/
COPY package.json yarn.lock ./
COPY ./cli/package.json ./cli/
COPY ./packages/core/package.json ./packages/core/
COPY ./packages/model/package.json ./packages/model/
COPY ./packages/testing/package.json ./packages/testing/

# for every new package foo add:
# ADD ./packages/foo/package.json ./packages/foo/
# COPY ./packages/foo/package.json ./packages/foo/

# install and build backend
RUN yarn install --frozen-lockfile
Expand All @@ -30,16 +30,16 @@ FROM node:18-alpine

WORKDIR /app

ADD package.json yarn.lock ./
ADD ./cli/package.json ./cli/
COPY package.json yarn.lock ./
COPY ./cli/package.json ./cli/
COPY ./cli/*.ttl ./cli/
ADD ./cli/pipelines ./cli/pipelines/
ADD ./packages/core/package.json ./packages/core/
ADD ./packages/model/package.json ./packages/model/
ADD ./packages/testing/package.json ./packages/testing/
COPY ./cli/pipelines ./cli/pipelines/
COPY ./packages/core/package.json ./packages/core/
COPY ./packages/model/package.json ./packages/model/
COPY ./packages/testing/package.json ./packages/testing/

# for every new package foo add
#ADD ./packages/foo/package.json ./packages/foo/
#COPY ./packages/foo/package.json ./packages/foo/

RUN yarn install --production --frozen-lockfile
COPY --from=builder /app/dist/cli ./cli/
Expand Down

0 comments on commit 345d270

Please sign in to comment.