version: "3.0"

services:

    wordpress:
        build: docker/
        restart: always
        environment:
            REMOTES:
            MAIL_DOMAIN:
            MAIL_FROM:
            TZ: ${TZ}
            WORDPRESS_DB_HOST: db
            WORDPRESS_DB_USER: ${DB_USERNAME}
            WORDPRESS_DB_PASSWORD: ${DB_PASSWORD}
            WORDPRESS_DB_NAME: ${DB_DATABASE}
            WORDPRESS_TABLE_PREFIX: ${DB_PREFIX}
            WORDPRESS_DEBUG: ${DEBUG}
            WORDPRESS_CONFIG_EXTRA: |
                /**
                 * Other customizations.
                */
                define('FS_METHOD','direct');
                define('FS_CHMOD_DIR',0775);
                define('FS_CHMOD_FILE',0664);
        volumes:
            - "${WP_PATH}:/var/www/html/"
            - "./log:/var/log"

    db:
        image: mariadb
        restart: always
        environment:
            TZ: ${TZ}
            MYSQL_DATABASE: ${DB_DATABASE}
            MYSQL_USER: ${DB_USERNAME}
            MYSQL_PASSWORD: ${DB_PASSWORD}
            MYSQL_RANDOM_ROOT_PASSWORD: 1
        volumes:
            - "./db:/var/lib/mysql"
