version: '3'
services:
    webservice:
        image: zoomyboy/adrema-webservice:latest
        restart: always
        depends_on:
            - php
        ports:
            - '8000:80'
        volumes:
            - ./data/storage/public:/app/storage/app/public

    php:
        image: zoomyboy/adrema-app:latest
        restart: always
        depends_on:
            - db
            - redis
            - socketi
        command: /bin/entrypoint app
        env_file:
            - .app.env
        environment:
            DB_HOST: db
            DB_DATABASE: db
            DB_USERNAME: db
            QUEUE_CONNECTION: redis
            XELATEX_BIN: /usr/bin/xelatex
            PDFLATEX_BIN: /usr/bin/pdflatex
            REDIS_HOST: redis
            MEILISEARCH_HOST: http://meilisearch:7700
            MEILISEARCH_KEY: abc
        volumes:
            - ./data/storage:/app/storage/app
            - ./data/plugins:/app/plugins
            - ./data/cookies:/app/packages/laravel-nami/.cookies
            - ./data/invoice:/app/resources/views/tex/invoice

    horizon:
        image: zoomyboy/adrema-app:latest
        restart: always
        depends_on:
            - php
        command: /bin/entrypoint horizon
        env_file:
            - .app.env
        environment:
            DB_HOST: db
            DB_DATABASE: db
            DB_USERNAME: db
            QUEUE_CONNECTION: redis
            XELATEX_BIN: /usr/bin/xelatex
            PDFLATEX_BIN: /usr/bin/pdflatex
            REDIS_HOST: redis
            MEILISEARCH_HOST: http://meilisearch:7700
            MEILISEARCH_KEY: abc
        volumes:
            - ./data/storage:/app/storage/app
            - ./data/plugins:/app/plugins
            - ./data/cookies:/app/packages/laravel-nami/.cookies
            - ./data/invoice:/app/resources/views/tex/invoice

    schedule:
        image: zoomyboy/adrema-app:latest
        restart: always
        depends_on:
            - php
        command: /bin/entrypoint schedule
        env_file:
            - .app.env
        environment:
            DB_HOST: db
            DB_DATABASE: db
            DB_USERNAME: db
            QUEUE_CONNECTION: redis
            XELATEX_BIN: /usr/bin/xelatex
            PDFLATEX_BIN: /usr/bin/pdflatex
            REDIS_HOST: redis
            MEILISEARCH_HOST: http://meilisearch:7700
            MEILISEARCH_KEY: abc
        volumes:
            - ./data/storage:/app/storage/app
            - ./data/plugins:/app/plugins
            - ./data/cookies:/app/packages/laravel-nami/.cookies
            - ./data/invoice:/app/resources/views/tex/invoice

    db:
        image: mariadb:10.6.5
        restart: always
        env_file:
            - .app.env
        environment:
            MARIADB_RANDOM_ROOT_PASSWORD: yes
            MYSQL_DATABASE: db
            MYSQL_USER: db
        volumes:
            - ./data/db:/var/lib/mysql

    socketi:
        image: quay.io/soketi/soketi:89604f268623cf799573178a7ba56b7491416bde-16-debian
        restart: always
        environment:
            SOKETI_DEFAULT_APP_ID: adremaid
            SOKETI_DEFAULT_APP_KEY: adremakey
            SOKETI_DEFAULT_APP_SECRET: adremasecret

    redis:
        image: redis:alpine3.18
        restart: always
        volumes:
            - ./data/redis:/data

    meilisearch:
        image: getmeili/meilisearch:v1.6
        command: 'meilisearch --master-key="abc"'
        volumes:
            - ./data/meilisearch:/meili_data