name: betlehem_light
services:
    mysql:
        image: mysql:8.0
        restart: unless-stopped
        environment:
            MYSQL_DATABASE: ${DB_DATABASE}
            MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
            MYSQL_PASSWORD: ${DB_PASSWORD}
            MYSQL_USER: ${DB_USERNAME}
            SERVICE_TAGS: dev
            SERVICE_NAME: mysql
        volumes:
            - mysql:/var/lib/mysql
        ports:
            - "3306:3306"
        networks:
            - app-network
        healthcheck:
            test: ["CMD", "mysqladmin", "ping", "-p${DB_PASSWORD}"]
            retries: 3
            timeout: 5s

    phpmyadmin:
        image: phpmyadmin/phpmyadmin
        environment:
            PMA_HOST: mysql
            PMA_USER: ${DB_USERNAME}       # Add this line
            PMA_PASSWORD: ${DB_PASSWORD}   # Add this line
            MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
        ports:
            - "8080:80"
        networks:
            - app-network
        depends_on:
            - mysql

networks:
    app-network:
        driver: bridge

volumes:
    mysql:
        driver: local


#    DB_CONNECTION=mysql
#    DB_HOST=127.0.0.1
#    DB_PORT=3306
#    DB_DATABASE=piamia
#    DB_USERNAME=piamia
#    DB_PASSWORD=password12345
