Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions docker-compose.dev.yml
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
Comment on lines +23 to +25

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep the MySQL auth workaround in dev compose

When a developer starts a fresh DB with this new file, the caquick user is created with MySQL 8's default auth because this command omits the workaround already used in docker-compose.yml:5-9 and the init script's ALTER USER in docker/mysql/init/01-grant-shadow-db.sql:5-8. The repo documents that Prisma 6.x can surface that default as the unsupported sha256_password, so this dev compose can reproduce the startup error the change is intended to avoid.

Useful? React with 👍 / 👎.

volumes:
- caquick-mysql-data:/var/lib/mysql

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Grant the dev user shadow-database privileges

When this local DB is used with the existing dev migration flow (README.md:252-253 / package.json:22-23), Prisma migrate dev needs to create a shadow database; the existing init SQL grants that explicitly in docker/mysql/init/01-grant-shadow-db.sql:1-3. This new compose only mounts the data volume, so a fresh MYSQL_USER is limited to the CaQuick database and local migration creation will fail unless the init directory is mounted or equivalent CREATE/ALL privileges are granted.

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:
Loading