version: '3.8'

services:
  app:
    build: .
    ports:
      - "8080:8080" # Replace with your application's port
    environment:
      - DB_HOST=db
      - DB_PORT=3306
      - DB_USER=root
      - DB_PASSWORD=mysecret
    depends_on:
      - db

  db:
    image: mariadb:latest
    environment:
      MYSQL_ROOT_PASSWORD: mysecret
      MYSQL_DATABASE: myappdb
      MYSQL_USER: myappuser
      MYSQL_PASSWORD: myapppassword
    ports:
      - "3306:3306"
    volumes:
      - ./db:/var/lib/mysql
