version: "3"
services:
    webserver:
        image: sudip91soani/laradock
        container_name: ${CONTAINER_PREFIX:-kmis}
        ports:
            - "${APP_PORT:-8000}:80"
        environment:
            LARAVEL_SAIL: 1
            WWWUSER: "${WWWUSER:-1000}"
            XDEBUG_MODE: "${SAIL_XDEBUG_MODE:-off}"
            XDEBUG_CONFIG: "${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}"
        volumes:
            - ".:/var/www/html"
        networks:
            - internal
        depends_on:
            - mysql
            - mailpit

    mysql:
        image: mysql:8.0.31
        container_name: ${CONTAINER_PREFIX:-kmis}_mysql
        ports:
            - "${DATABASE_PORT:-8001}:3306"
        environment:
            MYSQL_USER: "${DB_USERNAME:-kmis}"
            MYSQL_PASSWORD: "${DB_PASSWORD:-kmis}"
            MYSQL_DATABASE: "${DB_DATABASE:-kmis}"
            MYSQL_ROOT_PASSWORD: "${DB_PASSWORD:-kmis}"
        volumes:
            - mysql:/var/lib/mysql
        networks:
            - internal

    mailpit:
        image: axllent/mailpit
        container_name: ${CONTAINER_PREFIX:-kmis}_mailpit
        ports:
            - "${MAILPIT_UI_PORT:-8002}:8025"
        networks:
            - internal

networks:
    internal:
        driver: bridge

volumes:
    mysql:
        driver: local
