Skip to content

Commit

Permalink
chore: Yarn에서 npm으로 마이그레이션
Browse files Browse the repository at this point in the history
README.md, Dockerfile, pre-commit 파일들을 변경하고, 의존성을 업그레이드한다.
  • Loading branch information
JHyeok committed Nov 2, 2024
1 parent e0464d2 commit cc5674c
Show file tree
Hide file tree
Showing 8 changed files with 12,766 additions and 6,977 deletions.
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint-staged
npx lint-staged
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@ FROM node:20.12.2-alpine AS builder

WORKDIR /usr/src/app

COPY package.json yarn.lock ./
RUN yarn install --immutable --immutable-cache --check-cache
COPY package*.json ./
RUN npm install

COPY . .
RUN yarn build
RUN npm run build

RUN yarn install --production
# devDependencies 제거
RUN npm prune --production

FROM node:20.12.2-alpine AS deploy

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM node:20.12.2-alpine AS builder
WORKDIR /usr/src/app
COPY . .

RUN yarn install && yarn build
RUN npm install && npm run build

FROM node:20.12.2-alpine

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ git clone [email protected]:JHyeok/nestjs-api-example.git nestjs-project
cd nestjs-project

# 3. 의존성 설치
yarn install
npm install
```

설치가 끝났으면 `src/.env.example`을 복사해서 `.env`를 만듭니다.
Expand Down Expand Up @@ -54,14 +54,14 @@ $ docker-compose -f docker-compose.dev.yml down -v

```bash
# 운영 환경으로 실행
$ yarn start:prod
$ npm run start:prod

# 개발 환경으로 실행
$ yarn start:dev
$ npm run start:dev
```

## 테스트

```bash
$ yarn test
$ npm run test
```
2 changes: 1 addition & 1 deletion docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ services:
- -c
- |
/wait-for-it.sh db:3306 -t 15
yarn start:dev
npm run start:dev
env_file:
- .env
networks:
Expand Down
Loading

0 comments on commit cc5674c

Please sign in to comment.