services:
  web:
    build: .
    image: php8.2-apache-browsershot
    container_name: ${COMPOSE_PROJECT_NAME}-web
    user: www-data:www-data
    ports:
      - ${CRM_PORT:-80}:80
      - ${PROSPECTS_PORT:-81}:81
    volumes:
      - ../:/var/www/html/crm
      - ${PROSPECTS_PATH}:/var/www/html/prospects
      - ./php/php.ini:/usr/local/etc/php/conf.d/php.ini
      - ./apache/default.conf:/etc/apache2/sites-enabled/000-default.conf
  mariadb:
    image: mariadb:10.6
    container_name: ${COMPOSE_PROJECT_NAME}-mariadb
    ports:
      - ${DB_PORT:-3306}:3306
    environment:
      MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
      MYSQL_DATABASE: ${DB_DATABASE}
    volumes:
      - db-data:/var/lib/mysql
      - ./mariadb/my.cnf:/etc/mysql/conf.d/my.cnf
  mailpit:
    image: axllent/mailpit:latest
    container_name: ${COMPOSE_PROJECT_NAME}-mailpit
    ports:
      - '${MAILPIT_PORT:-1025}:1025'
      - '${MAILPIT_DASHBOARD_PORT:-8025}:8025'
volumes:
  db-data: