-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
157 additions
and
81 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#lib | ||
node_modules | ||
package-lock.json | ||
#dist | ||
dist | ||
|
||
#git에 올라갈 때 쯤에는 이 환경변수들을 사용할 수 없어요! | ||
##env | ||
#.env | ||
##secret | ||
#src/module/auth/constants.ts | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,7 +39,4 @@ lerna-debug.log* | |
#.env | ||
.env | ||
|
||
# constants | ||
/src/module/auth/constants.ts | ||
|
||
./src/__tests__/reservation/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
FROM ubuntu:latest | ||
LABEL authors="kjjdsa" | ||
|
||
ENTRYPOINT ["top", "-b"] | ||
|
||
# 베이스 이미지 선택 | ||
FROM node:18 | ||
|
||
# 작업 디렉토리 설정 | ||
WORKDIR /src | ||
|
||
# 앱 종속성 설치 | ||
COPY package.json ./ | ||
RUN npm install | ||
|
||
# 앱 소스 코드 복사 | ||
COPY . . | ||
|
||
# 포트 노출 | ||
EXPOSE 3000 | ||
|
||
# mysql 서버가 실행되기 전에 앱이 실행되는것을 막아주는 스크립트래요. 이게 문제였던건 아닌것 같지만 사용했습니당 | ||
ADD https://github.com/vishnubob/wait-for-it/raw/master/wait-for-it.sh /wait-for-it.sh | ||
RUN chmod +x /wait-for-it.sh | ||
|
||
# 앱 실행 명령 | ||
CMD /wait-for-it.sh mysql:3306 -- npm run start:seed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
version: '3' | ||
services: | ||
# 컨테이너 | ||
nest: | ||
# 컨테이너의 호칭 | ||
container_name: v0.2 | ||
# 빌드에 사용하는 이미지 혹은 도커파일(저희의 경우 도커파일.) | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
# 외부 포트 : 내부 포트 | ||
ports: | ||
- '3000:3000' | ||
# 이 컨테이너에서 사용할 다른 컨테이너(docker compose 의 특장점?) | ||
depends_on: | ||
- mysql | ||
mysql: | ||
image: mysql:latest | ||
# 비밀번호 값을 해시해서 보관하는 옵션을 준대요 | ||
command: --default-authentication-plugin=mysql_native_password | ||
# 환경변수 설정 | ||
environment: | ||
MYSQL_ROOT_PASSWORD: 1080 | ||
MYSQL_DATABASE: animalnest | ||
ports: | ||
- '3306:3306' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
CREATE USER 'user'@'%' IDENTIFIED BY '1080'; | ||
GRANT CREATE, ALTER, INDEX, LOCK TABLES, REFERENCES, UPDATE, DELETE, DROP, SELECT, INSERT ON `animalnest`.* TO 'user'@'%'; |
2 changes: 1 addition & 1 deletion
2
src/module/doctor/doctor.service.spec.ts → src/__tests__/doctor/doctor.service.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export class jwtConstants { | ||
static readonly secret: string = 'your_secret_key'; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,55 @@ | ||
import { TypeOrmModule } from "@nestjs/typeorm"; | ||
import { seeder } from "nestjs-seeder"; | ||
import { DoctorEntity } from "./module/doctor/doctor.entity"; | ||
import { DoctorModule } from "./module/doctor/doctor.module"; | ||
import { DoctorSeeder } from "./module/doctor/doctor.seeder"; | ||
import { ConfigModule, ConfigService } from "@nestjs/config"; | ||
import { UserSeeder } from "./module/user/user.seeder"; | ||
import { UserEntity } from "./module/user/data/user.entity"; | ||
import { UserModule } from "./module/user/user.module"; | ||
import { CounselingEntity } from "./module/counseling/data/counseling.entity"; | ||
import { PaymentEntity } from "./module/payment/data/payment.entity"; | ||
import { PetEntity } from "./module/pet/data/pet.entity"; | ||
import { PetSeeder } from "./module/pet/pet.seeder"; | ||
import { PetModule } from "./module/pet/pet.module"; | ||
import { TypeOrmModule } from '@nestjs/typeorm'; | ||
import { seeder } from 'nestjs-seeder'; | ||
import { DoctorEntity } from './module/doctor/data/doctor.entity'; | ||
import { DoctorModule } from './module/doctor/doctor.module'; | ||
import { DoctorSeeder } from './module/doctor/doctor.seeder'; | ||
import { ConfigModule, ConfigService } from '@nestjs/config'; | ||
import { UserSeeder } from './module/user/user.seeder'; | ||
import { UserEntity } from './module/user/data/user.entity'; | ||
import { UserModule } from './module/user/user.module'; | ||
import { CounselingEntity } from './module/counseling/data/counseling.entity'; | ||
import { PaymentEntity } from './module/payment/data/payment.entity'; | ||
import { PetEntity } from './module/pet/data/pet.entity'; | ||
import { PetSeeder } from './module/pet/pet.seeder'; | ||
import { PetModule } from './module/pet/pet.module'; | ||
|
||
seeder({ | ||
imports: [ | ||
ConfigModule.forRoot({ | ||
isGlobal: true, | ||
}), | ||
PetModule, UserModule, DoctorModule, | ||
TypeOrmModule.forRootAsync({ | ||
inject: [ConfigService], | ||
useFactory: async (configService: ConfigService) => { | ||
return { | ||
type: 'mysql', | ||
host: 'localhost', | ||
port: Number(configService.get('DB_PORT')), | ||
username: configService.get('DB_USER'), | ||
password: configService.get('DB_PW'), | ||
database: configService.get('DB_SCHEMA'), | ||
autoLoadEntities: true, | ||
synchronize: true, | ||
dropSchema: true, | ||
entities: [DoctorEntity,UserEntity, PetEntity, CounselingEntity,PaymentEntity], | ||
} | ||
} | ||
}), | ||
TypeOrmModule.forFeature([DoctorEntity,UserEntity, PetEntity, CounselingEntity,PaymentEntity]), | ||
] | ||
}).run([DoctorSeeder, UserSeeder, PetSeeder]); | ||
imports: [ | ||
ConfigModule.forRoot({ | ||
isGlobal: true, | ||
}), | ||
PetModule, | ||
UserModule, | ||
DoctorModule, | ||
TypeOrmModule.forRootAsync({ | ||
inject: [ConfigService], | ||
useFactory: async (configService: ConfigService) => { | ||
return { | ||
type: 'mysql', | ||
host: configService.get('DB_HOST'), | ||
port: Number(configService.get('DB_PORT')), | ||
username: configService.get('DB_USER'), | ||
password: configService.get('DB_PW'), | ||
database: configService.get('DB_SCHEMA'), | ||
autoLoadEntities: true, | ||
synchronize: true, | ||
dropSchema: true, | ||
entities: [ | ||
DoctorEntity, | ||
UserEntity, | ||
PetEntity, | ||
CounselingEntity, | ||
PaymentEntity, | ||
], | ||
}; | ||
}, | ||
}), | ||
TypeOrmModule.forFeature([ | ||
DoctorEntity, | ||
UserEntity, | ||
PetEntity, | ||
CounselingEntity, | ||
PaymentEntity, | ||
]), | ||
], | ||
}).run([DoctorSeeder, UserSeeder, PetSeeder]); |