services:
  smssmart_php:
    container_name: smssmart_php
    restart: always
    expose:
      - 9000
    build:
      context: ./config/local/php/5.6
      dockerfile: ./fpm_Dockerfile
    volumes:
      - /var/www/html:/var/www/html
    extra_hosts:
      - "dmm.localhost:192.168.185.4"
      - "clic.localhost:192.168.185.4"
      - "story.localhost:192.168.185.4"
      - "um.localhost:192.168.185.4"
      - "cookieservice.localhost:192.168.185.4"
      - "3steps.localhost:192.168.185.4"
      - "freetrial.localhost:192.168.185.4"
      - "media.localhost:192.168.185.4"
      - "hr_effedue.localhost:192.168.185.4"
    networks:
      local_net:
        ipv4_address: 192.168.185.2
  wpn_php:
    container_name: wpn_php
    restart: always
    expose:
      - 9000
    build:
      context: ./config/local/php/7.4
      dockerfile: ./fpm_Dockerfile
    volumes:
      - /var/www/html:/var/www/html
    extra_hosts:
      - "dmm.localhost:192.168.185.4"
      - "clic.localhost:192.168.185.4"
      - "story.localhost:192.168.185.4"
      - "um.localhost:192.168.185.4"
      - "cookieservice.localhost:192.168.185.4"
      - "3steps.localhost:192.168.185.4"
      - "freetrial.localhost:192.168.185.4"
      - "media.localhost:192.168.185.4"
      - "hr_effedue.localhost:192.168.185.4"
    networks:
      local_net:
        ipv4_address: 192.168.185.3
  apache: 
    container_name: apache
    restart: always
    depends_on:
      - smssmart_php
      - wpn_php
      - crm_php
      - crm_db
    ports:
      - "80:80"
      - "443:443"
      - "8000:8000"
      - "8001:8001"
    build: ./config/local/apache2
    volumes:
      - /var/www/html:/var/www/html
      - ./config/local/apache2/virtualhosts:/etc/apache2/sites-enabled
    extra_hosts:
      - "dmm.localhost:127.0.0.1"
      - "clic.localhost:127.0.0.1"
      - "story.localhost:127.0.0.1"
      - "um.localhost:127.0.0.1"
      - "cookieservice.localhost:127.0.0.1"
      - "3steps.localhost:127.0.0.1"
      - "freetrial.localhost:127.0.0.1"
      - "media.localhost:127.0.0.1"
      - "hr_effedue.localhost:127.0.0.1"
    networks:
      local_net:
        ipv4_address: 192.168.185.4
  crm_php:
    container_name: crm_php
    restart: always
    expose:
      - 9000
    build:
      context: ./config/local/php/8.1
      dockerfile: ./fpm_Dockerfile
    volumes:
      - /var/www/html/crm_vendita:/var/www/html/crm_vendita
    extra_hosts:
      - "dmm.localhost:192.168.185.4"
      - "hr_effedue.localhost:192.168.185.4"
    networks:
      local_net:
        ipv4_address: 192.168.185.5
  crm_db:
    container_name: crm_db
    restart: always
    image: mariadb:10.6
    environment:
      MARIADB_USER: "root"
      MARIADB_PASSWORD: "pupazzetto"
      MARIADB_ROOT_PASSWORD: "pupazzetto"
    volumes:
      - crm_db_data:/var/lib/mysql
    networks:
      local_net:
        ipv4_address: 192.168.185.6
volumes:
  crm_db_data: 
networks:
  local_net:
    ipam:
      driver: default
      config:
        - subnet: "192.168.185.0/24"