
version: "3.8"
services:
  db:
    image: mysql:8
    environment:
      MYSQL_ROOT_PASSWORD: lqQMPLSfTou
      MYSQL_DATABASE: weight_tracker
      MYSQL_USER: tracker
      MYSQL_PASSWORD: MXj8w2qILzX
    ports:
      - "30006:3306"
    volumes:
      - db_data:/var/lib/mysql
    healthcheck:
      test: ["CMD-SHELL","mysqladmin ping -h localhost -p$$MYSQL_ROOT_PASSWORD"]
      interval: 5s
      retries: 10
      start_period: 10s
  app:
    build: ./backend
    depends_on:
      db:
        condition: service_healthy
    ports:
      - "8081:8081"
volumes:
  db_data:
