
services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: atenas_app
    ports:
      - "8080:80"
    volumes:
      - .:/var/www/html
    depends_on:
      - db
    environment:
      - DB_HOST=db
      - DB_PORT=3306
      - DB_DATABASE=atenas_db
      - DB_USERNAME=laravel
      - DB_PASSWORD=secret
    networks:
      - atenas_net

  db:
    image: mysql:8.0
    container_name: atenas_db
    restart: always
    environment:
      MYSQL_ROOT_PASSWORD: root
      MYSQL_DATABASE: atenas_db
      MYSQL_USER: laravel
      MYSQL_PASSWORD: secret
    ports:
      - "3307:3306"
    volumes:
      - dbdata:/var/lib/mysql
    networks:
      - atenas_net

  phpmyadmin:
    image: phpmyadmin/phpmyadmin
    container_name: atenas_phpmyadmin
    restart: always
    depends_on:
      - db
    ports:
      - "8081:80"
    environment:
      PMA_HOST: db
      MYSQL_ROOT_PASSWORD: root
    networks:
      - atenas_net

volumes:
  dbdata:

networks:
  atenas_net:
    driver: bridge
