# docker-compose.yml
version: '3.8'
services:
  app:
    image: node:18
    working_dir: /app
    volumes:
      - ./:/app
    ports:
      - "3000:3000"
    environment:
      - NODE_ENV=development
      - PORT=3000
      - DB_HOST=db
      - DB_USER=root
      - DB_PASS=secret
      - DB_NAME=smoobu_clone
      # ... other environment variables
    command: npm run dev
  db:
    image: mysql:8
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: secret
      MYSQL_DATABASE: smoobu_clone
    ports:
      - "3306:3306"
    volumes:
      - db_data:/var/lib/mysql

volumes:
  db_data:
