services:
    redis:
        image: redis:alpine
        command: [ redis-server, --maxmemory, 128mb, --maxmemory-policy, volatile-lru, --save, '""' ]

    db:
        image: mariadb:10.7
        working_dir: /application
        command: [mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_unicode_ci, --innodb-file-per-table=1]
        volumes:
            - pimcore-demo-database:/var/lib/mysql
        environment:
            MYSQL_ROOT_PASSWORD: ROOT
            MYSQL_DATABASE: pimcore
            MYSQL_USER: pimcore
            MYSQL_PASSWORD: pimcore

    nginx:
        image: nginx:stable-alpine
        ports:
            - "80:80"
        volumes:
            - .:/var/www/html:ro
            - ./.docker/nginx.conf:/etc/nginx/conf.d/default.conf:ro
        depends_on:
            - php-fpm
            - php-fpm-debug

    php-fpm:
        #user: '1000:1000' # set to your uid:gid
        image: pimcore/pimcore:PHP8.1-fpm
        environment:
            COMPOSER_HOME: /var/www/html
        depends_on:
            - db
        volumes:
            - .:/var/www/html
            - pimcore-tmp-storage:/tmp

    php-fpm-debug:
        #user: '1000:1000' # set to your uid:gid
        image: pimcore/pimcore:PHP8.1-fpm-debug
        environment:
            PHP_IDE_CONFIG: serverName=localhost
            COMPOSER_HOME: /var/www/html
        depends_on:
            - db
        volumes:
            - .:/var/www/html
            - pimcore-tmp-storage:/tmp

    supervisord:
        #user: '1000:1000' # set to your uid:gid
        image: pimcore/pimcore:PHP8.1-supervisord
        depends_on:
            - db
        volumes:
            - .:/var/www/html
            - ./.docker/supervisord.conf:/etc/supervisor/conf.d/pimcore.conf:ro


volumes:
    pimcore-demo-database:
    pimcore-tmp-storage:
