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

    db:
        image: mariadb:10.11
        working_dir: /application
        command: [ mysqld, --character-set-server=utf8mb4, --collation-server=utf8mb4_general_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

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

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

    gotenberg:
        image: gotenberg/gotenberg:8

    mailpit:
        image: axllent/mailpit
        restart: unless-stopped
        volumes:
            - pimcore-demo-mailpit-data:/data
        ports:
            - 8025:8025
        environment:
            MP_MAX_MESSAGES: 5000
            MP_DATA_FILE: /data/mailpit.db
            MP_SMTP_AUTH_ACCEPT_ANY: 1
            MP_SMTP_AUTH_ALLOW_INSECURE: 1

volumes:
    pimcore-demo-database:
    pimcore-demo-redis-data:
    pimcore-demo-tmp-storage:
    pimcore-demo-mailpit-data:
