# sudo docker-compose build
# sudo docker-compose up
# sudo docker-compose up --build

# Subir em background
# sudo docker-compose -f docker-compose.yml up -d

# How use iterative mode container
# sudo docker-compose exec apache_php bash


#Purging All Unused or Dangling Images, Containers, Volumes, and Networks
#sudo docker system prune -a

services:

  apache_php:
    build:
      dockerfile: adianti_debian12_php8.2.Dockerfile
      context: .
    image: adianti_debian12_php8.2:last
    container_name: adianti_debian12_php8.2
    restart: always
    ports:
      - "80:80"
      - "443:443"
      - "9003:9003"
    networks:
      - formdin-network
    volumes:
      #- ./000-default.conf:/etc/apache2/sites-enabled/000-default.conf
      - ./php.ini:/etc/php/8.2/apache2/php.ini:ro
      - ./www:/var/www/html:rw               #WWW ROOT
      - ./log_apache:/var/log/apache2:rw #Log Apahce

  mariadb:
    image: mariadb:10.11
    container_name: mariadb
    restart: on-failure
    environment:
      #MYSQL_ALLOW_EMPTY_PASSWORD: 1
      MYSQL_ROOT_PASSWORD: p123456
      MYSQL_DATABASE: mybb
      MYSQL_USER: mybb
      MYSQL_PASSWORD: mybb
    ports:
      - "3306:3306"
    volumes:
      - ./mariadb_database:/var/lib/mysql    # Volume para os dados do banco de dados
      - ./mariadb_logs:/var/log/mysql        # Volume para os logs do MySQL
    networks:
      - formdin-network

  adminer:
    image: adminer
    container_name: adminer
    restart: always
    networks:
      - formdin-network
    ports:
      - 8080:8080

  phpmyadmin:
    image: phpmyadmin
    container_name: phpmyadmin
    restart: always
    environment:
      PMA_ARBITRARY: 1
    ports:
      - 9090:80
    networks:
      - formdin-network

networks: 
    formdin-network:
        driver: bridge