# docker-compose.yml
services:
  app:
    build: .
    ports:
      - "5000:5000"
    environment:
      - DB_HOST=mysql
      - DB_USER=root
      - DB_PASSWORD=ephnet254
      - DB_NAME=schooly_db
      - JWT_SECRET=your_jwt_secret_key
    volumes:
      - .:/usr/src/app
      - /usr/src/app/node_modules
    depends_on:
      - mysql
    restart: unless-stopped

  mysql:
    image: mysql:8.0
    environment:
      MYSQL_ROOT_PASSWORD: ephnet254
      MYSQL_DATABASE: schooly_db
    volumes:
      - mysql-data:/var/lib/mysql
    ports:
      - "3306:3306"
    restart: unless-stopped

volumes:
  mysql-data: