services:

  underdog-frontend:
    image: underdogfront
    build: ./frontend
    container_name: underdog-frontend
    ports:
      - "4201:80"
    restart: unless-stopped

  underdog-backend:
    image: underdog-backend
    build: ./backend
    container_name: underdog-backend
    ports:
      - "9001:9000"
    volumes:
      - ./backend:/var/www/html
    depends_on:
      - underdog-db
    environment:
      DB_HOST: underdog-db
      DB_DATABASE: underdog
      DB_USERNAME: root
      DB_PASSWORD: root
    restart: unless-stopped

  underdog-db:
    image: mysql:8.0
    container_name: underdog-db
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: underdog
    ports:
      - "3308:3306"
    volumes:
      - underdog_mysql:/var/lib/mysql
    restart: unless-stopped

volumes:
  underdog_mysql:
