# WBX Spring Framework — 로컬 개발 인프라
# 사용법: docker compose -f docker-compose-dev.yml up -d
#
# MySQL(:3306) + PostgreSQL(:5432) + Redis(:6379) 동시 실행
# --profile mysql  → MySQL만
# --profile pg     → PostgreSQL만

services:
  mysql:
    image: mysql:8.0
    profiles: ["mysql", "default"]
    ports:
      - "3306:3306"
    environment:
      MYSQL_DATABASE: mos
      MYSQL_USER: jsh
      MYSQL_PASSWORD: jsh@
      MYSQL_ROOT_PASSWORD: rootpassword
    volumes:
      - mysql_dev:/var/lib/mysql
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci

  postgresql:
    image: postgres:16-alpine
    profiles: ["pg"]
    ports:
      - "5432:5432"
    environment:
      POSTGRES_DB: mos
      POSTGRES_USER: jsh
      POSTGRES_PASSWORD: jsh@
    volumes:
      - pg_dev:/var/lib/postgresql/data

  redis:
    image: redis:7-alpine
    ports:
      - "6379:6379"

volumes:
  mysql_dev:
  pg_dev:
