Skip to content

Commit f5b9e7c

Browse files
committed
chore(yarn): use yarn in docker instead of npm and remove the package-lock file
1 parent 5cb95ec commit f5b9e7c

File tree

6 files changed

+131
-9852
lines changed

6 files changed

+131
-9852
lines changed

Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,22 @@ FROM node:22-alpine${ALPINE_VERSION} AS base
55
WORKDIR /usr/src/app
66

77
COPY package.json ./
8-
COPY package-lock.json ./
8+
COPY yarn.lock ./
99

1010

11-
##
11+
###
1212
FROM base AS builder
1313

1414
WORKDIR /usr/src/app
1515

1616
RUN --mount=type=cache,target=/usr/src/app/node_modules \
17-
npm ci
17+
yarn --frozen-lockfile
1818

1919
COPY ./prisma ./prisma
2020
COPY ./src ./src
2121
COPY ./tsconfig.json .
2222

23-
RUN npx prisma generate && npm run build
23+
RUN npx prisma generate && yarn build
2424

2525

2626
###
@@ -29,7 +29,7 @@ FROM base AS prod-packages
2929
WORKDIR /usr/src/app
3030

3131
RUN --mount=type=cache,target=/usr/src/app/node_modules \
32-
npm install --only=production
32+
yarn --production
3333

3434
COPY ./prisma ./prisma
3535

dev.Dockerfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
FROM node:22-bookworm
22

3-
RUN --mount=type=cache,target=/usr/src/app/node_modules \
4-
npm i -g prisma nodemon
3+
RUN yarn global add prisma nodemon
54

65
WORKDIR /usr/src/app
76

8-
COPY package*.json .
7+
COPY package.json .
8+
COPY yarn.lock .
99
COPY tsconfig.json .
1010

1111
RUN --mount=type=cache,target=/usr/src/app/node_modules \
12-
npm i
12+
yarn
1313

1414
COPY prisma .
1515

@@ -19,4 +19,4 @@ COPY src src
1919

2020
EXPOSE 9000
2121

22-
CMD ["nodemon", "-w", "'src/**/*'", "src/index.ts"]
22+
CMD ["nodemon", "-w", "src/**/*", "src/index.ts"]

docker-compose.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,18 +76,17 @@ services:
7676
develop:
7777
watch:
7878
- action: rebuild
79-
path: trust_claim_backend/package.json
79+
path: ./package.json
8080
target: /usr/src/app/package.json
8181
- action: rebuild
82-
path: trust_claim_backend/package-lock.json
83-
target: /usr/src/app/package-lock.json
82+
path: ./yarn.lock
83+
target: /usr/src/app/yarn.lock
8484
- action: rebuild
85-
path: trust_claim_backend/tsconfig.json
85+
path: ./tsconfig.json
8686
target: /usr/src/app/tsconfig.json
8787
- action: rebuild
88-
path: trust_claim_backend/prisma
88+
path: ./prisma
8989
target: /usr/src/app/prisma
90-
9190
- action: sync
9291
path: src
9392
target: /usr/src/app/src

0 commit comments

Comments
 (0)