diff --git a/.commitlintrc.json b/.commitlintrc.json index 89dde95e..e00a41e3 100644 --- a/.commitlintrc.json +++ b/.commitlintrc.json @@ -1,6 +1,6 @@ { "extends": ["@commitlint/config-conventional"], "rules": { - "header-max-length": [2, "always", 50] + "header-max-length": [2, "always", 60] } } diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 00000000..2536746a --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,15 @@ +# 요약 \* + + + +It closes #issue_number + +# 스크린샷 + + + +# 이후 Task \* + + + +- 없음 diff --git a/docker-compose.yml b/docker-compose.yml index a3f89387..32f0e0ce 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,4 +1,4 @@ -version: "3.4" +version: "3.9" name: "biseo" services: @@ -28,7 +28,8 @@ services: context: . dockerfile: .docker/api.Dockerfile depends_on: - - db + db: + condition: service_healthy networks: - frontend - backend @@ -44,6 +45,11 @@ services: command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci networks: - backend + healthcheck: + test: "mysql -uroot -p$$MYSQL_ROOT_PASSWORD $$MYSQL_DATABASE -e 'select 1'" + start_period: 0s + interval: 1s + retries: 3 volumes: biseo-data: diff --git a/packages/api/docker-compose.dev.yml b/packages/api/docker-compose.dev.yml index e7558a9c..a9361e0b 100644 --- a/packages/api/docker-compose.dev.yml +++ b/packages/api/docker-compose.dev.yml @@ -12,6 +12,11 @@ services: volumes: - db:/var/lib/mysql command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci + healthcheck: + test: "mysql -uroot -p$$MYSQL_ROOT_PASSWORD $$MYSQL_DATABASE -e 'select 1'" + start_period: 0s + interval: 1s + retries: 30 volumes: db: diff --git a/packages/api/package.json b/packages/api/package.json index b7e1b640..51af927c 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -4,13 +4,13 @@ "main": "src/index.ts", "license": "MIT", "scripts": { - "dev": "pnpm migrate && nodemon", + "dev": "pnpm migrate:dev && nodemon", "prod": "prisma migrate deploy && node dist/index.js", "db": "docker compose -f docker-compose.dev.yml", "typecheck": "prisma generate && tsc --noEmit", "typegen": "prisma generate", - "migrate": "pnpm db up -d && prisma migrate dev", - "studio": "pnpm db up -d && prisma studio", + "migrate:dev": "pnpm db up --wait && prisma migrate dev", + "studio": "pnpm db up --wait && prisma studio", "build": "prisma generate && tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json", "env": "echo $NODE_ENV" },