services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
      - .:/var/www/html
    ports:
      - 8000:80
    depends_on:
      - db
    networks:
      - tis-app

  db:
    image: mysql:8.0.34
    ports:
      - 3306:3306
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: "${DB_PASSWORD:-password}"
      MYSQL_ROOT_HOST: "%"
      MYSQL_DATABASE: "${DB_DATABASE:-tis_db}"
      MYSQL_USER: "${DB_USERNAME:-dbuser}"
      MYSQL_PASSWORD: "${DB_PASSWORD:-password}"
      MYSQL_ALLOW_EMPTY_PASSWORD: 1
    volumes:
      - mysql_db:/var/lib/mysql
    networks:
      - tis-app

networks:
  tis-app:
    driver: bridge

volumes:
  mysql_db:
