Skip to content

Commit

Permalink
Merge pull request #409 from sparcs-kaist/feat/api-depends-on-mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
withSang authored Oct 10, 2023
2 parents 741c833 + 8865618 commit 18e7a68
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": ["@commitlint/config-conventional"],
"rules": {
"header-max-length": [2, "always", 50]
"header-max-length": [2, "always", 60]
}
}
15 changes: 15 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# 요약 \*

<!-- 닫는 이슈 번호 및 PR 내용에 대한 간단한 요약 표기. -->

It closes #issue_number

# 스크린샷

<!-- PR 변경 사항에 대한 스크린샷이나 .gif 파일 -->

# 이후 Task \*

<!-- PR 이후 개설할 이슈 목록 -->

- 없음
10 changes: 8 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "3.4"
version: "3.9"
name: "biseo"

services:
Expand Down Expand Up @@ -28,7 +28,8 @@ services:
context: .
dockerfile: .docker/api.Dockerfile
depends_on:
- db
db:
condition: service_healthy
networks:
- frontend
- backend
Expand All @@ -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:
Expand Down
5 changes: 5 additions & 0 deletions packages/api/docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
6 changes: 3 additions & 3 deletions packages/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down

0 comments on commit 18e7a68

Please sign in to comment.