-
Notifications
You must be signed in to change notification settings - Fork 0
chore: 로컬 개발 DB docker-compose 전환 (sha256_password 접속오류 해결) #151
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| # 로컬 개발용 MySQL (운영과 무관 — 개발 전용 자격증명). | ||
| # | ||
| # 사용: | ||
| # docker compose -f docker-compose.dev.yml up -d # 기동 | ||
| # docker compose -f docker-compose.dev.yml down # 중지(데이터 유지) | ||
| # docker compose -f docker-compose.dev.yml down -v # 중지 + 데이터 삭제 | ||
| # | ||
| # mysql:8.0 기본 인증은 caching_sha2_password 라 Prisma와 호환된다. | ||
| # (네이티브 brew mysql 의 sha256_password 계정에서 발생하던 접속 오류를 피한다) | ||
| # 자격증명은 .env / .env.example 의 DATABASE_URL 과 일치시킨다. | ||
| services: | ||
| mysql: | ||
| image: mysql:8.0 | ||
| container_name: caquick-mysql-dev | ||
| restart: unless-stopped | ||
| environment: | ||
| MYSQL_ROOT_PASSWORD: root | ||
| MYSQL_DATABASE: CaQuick | ||
| MYSQL_USER: caquick | ||
| MYSQL_PASSWORD: caquick | ||
| ports: | ||
| - '3306:3306' | ||
| command: | ||
| - --character-set-server=utf8mb4 | ||
| - --collation-server=utf8mb4_unicode_ci | ||
| volumes: | ||
| - caquick-mysql-data:/var/lib/mysql | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When this local DB is used with the existing dev migration flow ( Useful? React with 👍 / 👎. |
||
| healthcheck: | ||
| test: | ||
| ['CMD-SHELL', 'mysqladmin ping -h 127.0.0.1 -u root -proot --silent'] | ||
| interval: 5s | ||
| timeout: 5s | ||
| retries: 20 | ||
|
|
||
| volumes: | ||
| caquick-mysql-data: | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a developer starts a fresh DB with this new file, the
caquickuser is created with MySQL 8's default auth because this command omits the workaround already used indocker-compose.yml:5-9and the init script'sALTER USERindocker/mysql/init/01-grant-shadow-db.sql:5-8. The repo documents that Prisma 6.x can surface that default as the unsupportedsha256_password, so this dev compose can reproduce the startup error the change is intended to avoid.Useful? React with 👍 / 👎.