Skip to content

Commit

Permalink
Chore: 새로운 배포 관련
Browse files Browse the repository at this point in the history
  • Loading branch information
장서현 authored and 장서현 committed Aug 23, 2024
1 parent bde52ac commit 0fa88ef
Show file tree
Hide file tree
Showing 7 changed files with 2,868 additions and 2,335 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.git
.github
node_modules
34 changes: 34 additions & 0 deletions dockerfile.dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM node:20-alpine AS base

# node prune 설정
RUN apk add curl bash && curl -sfL https://gobinaries.com/tj/node-prune | bash -s -- -b /usr/local/bin

WORKDIR /usr/src/app

COPY package.json ./

RUN ls -a && yarn

FROM base AS dev

COPY . .

RUN ls -a && yarn build

# run node prune - 사용하지 않는 모듈 제거
RUN /usr/local/bin/node-prune

FROM node:20-alpine

COPY --from=base /usr/src/app/package.json ./
COPY --from=dev /usr/src/app/dist/ ./dist/
COPY --from=dev /usr/src/app/node_modules/ ./node_modules/

# port 설정
EXPOSE 3000

# 환경 변수 설정
ENV NODE_ENV=development

# start
CMD ["node", "dist/src/main.js"]
90 changes: 45 additions & 45 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,57 +21,57 @@
"test:e2e": "jest --config ./test/jest-e2e.json"
},
"dependencies": {
"@nestjs/axios": "^1.0.0",
"@nestjs/common": "^9.0.0",
"@nestjs/config": "^2.2.0",
"@nestjs/core": "^9.0.0",
"@nestjs/jwt": "^9.0.0",
"@nestjs/passport": "^9.0.0",
"@nestjs/platform-express": "^9.0.0",
"@nestjs/swagger": "^6.1.2",
"@prisma/client": "4.5.0",
"@nestjs/axios": "^3.0.3",
"@nestjs/common": "^10.4.1",
"@nestjs/config": "^3.2.3",
"@nestjs/core": "^10.4.1",
"@nestjs/jwt": "^10.2.0",
"@nestjs/passport": "^10.0.3",
"@nestjs/platform-express": "^10.4.1",
"@nestjs/swagger": "^7.4.0",
"@prisma/client": "5.18.0",
"@sentry/minimal": "^6.19.7",
"@sentry/node": "^7.20.0",
"@sentry/node": "^8.26.0",
"@slack/client": "^5.0.2",
"argon2": "^0.30.3",
"axios": "^1.1.3",
"argon2": "^0.40.3",
"axios": "^1.7.4",
"class-transformer": "^0.5.1",
"class-validator": "^0.13.2",
"dotenv": "^16.0.3",
"jsonwebtoken": "^9.0.0",
"jwks-rsa": "^3.0.1",
"passport": "^0.6.0",
"passport-jwt": "^4.0.0",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^7.2.0",
"swagger-ui-express": "^4.5.0"
"class-validator": "^0.14.1",
"dotenv": "^16.4.5",
"jsonwebtoken": "^9.0.2",
"jwks-rsa": "^3.1.0",
"passport": "^0.7.0",
"passport-jwt": "^4.0.1",
"reflect-metadata": "^0.2.2",
"rimraf": "^6.0.1",
"rxjs": "^7.8.1",
"swagger-ui-express": "^5.0.1"
},
"devDependencies": {
"@nestjs/cli": "^9.0.0",
"@nestjs/schematics": "^9.0.0",
"@nestjs/testing": "^9.0.0",
"@types/express": "^4.17.13",
"@types/jest": "28.1.4",
"@types/node": "^16.0.0",
"@types/passport-jwt": "^3.0.7",
"@types/supertest": "^2.0.11",
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "28.1.2",
"jest-mock-extended": "2.0.4",
"prettier": "^2.3.2",
"prisma": "^4.5.0",
"@nestjs/cli": "^10.4.4",
"@nestjs/schematics": "^10.1.4",
"@nestjs/testing": "^10.4.1",
"@types/express": "^4.17.21",
"@types/jest": "29.5.12",
"@types/node": "^22.5.0",
"@types/passport-jwt": "^4.0.1",
"@types/supertest": "^6.0.2",
"@typescript-eslint/eslint-plugin": "^8.2.0",
"@typescript-eslint/parser": "^8.2.0",
"eslint": "^9.9.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"jest": "29.7.0",
"jest-mock-extended": "3.0.7",
"prettier": "^3.3.3",
"prisma": "^5.18.0",
"source-map-support": "^0.5.20",
"supertest": "^6.1.3",
"ts-jest": "28.0.5",
"ts-loader": "^9.2.3",
"ts-node": "^10.0.0",
"tsconfig-paths": "4.0.0",
"typescript": "^4.3.5"
"supertest": "^7.0.0",
"ts-jest": "29.2.4",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
"tsconfig-paths": "4.2.0",
"typescript": "^5.5.4"
},
"jest": {
"moduleDirectories": [
Expand Down
41 changes: 19 additions & 22 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

generator client {
provider = "prisma-client-js"
provider = "prisma-client-js"
previewFeatures = ["extendedWhereUnique"]
}

Expand All @@ -12,31 +9,31 @@ datasource db {
}

model User {
id Int @id @default(autoincrement())
nickname String? @db.VarChar()
name String? @db.VarChar()
email String? @db.VarChar()
age String? @db.VarChar()
sex Int? @db.SmallInt()
preferredMap Int? @map("preferred_map") @db.SmallInt
socialType Int @map("social_type") @db.SmallInt
refreshToken String? @map("refresh_token") @db.VarChar()
kakaoId BigInt? @map("kakao_id") @db.BigInt()
appleId String? @map("apple_id") @db.VarChar()
appleRefreshToken String? @map("apple_refresh_token") @db.VarChar()
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
isDeleted Boolean @default(false) @map("is_deleted")
id Int @id @default(autoincrement())
createdAt DateTime @default(now()) @map("created_at")
isDeleted Boolean @default(false) @map("is_deleted")
nickname String? @db.VarChar
preferredMap Int? @map("preferred_map") @db.SmallInt
refreshToken String? @map("refresh_token") @db.VarChar
socialType Int @map("social_type") @db.SmallInt
updatedAt DateTime @updatedAt @map("updated_at")
age String? @db.VarChar
email String? @db.VarChar
name String? @db.VarChar
sex Int? @db.SmallInt
appleId String? @map("apple_id") @db.VarChar
kakaoId BigInt? @map("kakao_id")
appleRefreshToken String? @map("apple_refresh_token") @db.VarChar
}

model Map {
id Int @id @default(autoincrement())
latitude Float
longitude Float
address String @db.VarChar()
image String? @db.VarChar()
address String @db.VarChar
image String? @db.VarChar
areaType Int? @map("area_type") @db.SmallInt
areaName String @map("area_name") @db.VarChar()
areaName String @map("area_name") @db.VarChar
createdAt DateTime @default(now()) @map("created_at")
updatedAt DateTime @updatedAt @map("updated_at")
isDeleted Boolean @default(false) @map("is_deleted")
Expand Down
5 changes: 5 additions & 0 deletions src/app.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ export class AppController {
return this.appService.getHello();
}

@Get('ping')
ping(): boolean {
return true;
}

@UseGuards(AccessTokenGuard)
@Get('test')
async authenticationTest(@Req() req) {
Expand Down
2 changes: 1 addition & 1 deletion src/prisma.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class PrismaService extends PrismaClient implements OnModuleInit {
}

async enableShutdownHooks(app: INestApplication) {
this.$on('beforeExit', async () => {
process.on('beforeExit', async () => {
await app.close();
});
}
Expand Down
Loading

0 comments on commit 0fa88ef

Please sign in to comment.