version: "3.8"

services:
  micro-app:
    build: .
    container_name: ${APP}
    volumes:
      - ./:/app
    ports:
      - "${PORT}:${PORT}"
    command: sh -c "npm install && npm run dev"
  db:
    image: mysql:8.1
    container_name: my_mysql
    environment:
      MYSQL_ROOT_PASSWORD: tnals1459
      MYSQL_USER: how2ice
      MYSQL_PASSWORD: tnals1459
      MYSQL_DATABASE: mydb
    volumes:
      # 초기화 SQL 스크립트 폴더
      - ./db_data/init.d:/docker-entrypoint-initdb.d:ro
      # MySQL 데이터 저장
      - ./db_data/data:/var/lib/mysql
    #ports:
      #- "3306:3306"

