#!/bin/bash

source "$PWD/.env"

php /var/www/html/bin/magento setup:install \
    --base-url=$APP_URL \
    --db-host=mysql \
    --db-name=$MYSQL_DATABASE \
    --db-user=$MYSQL_USER \
    --db-password=$MYSQL_PASSWORD \
    --admin-firstname=$ADMIN_FIRSTNAME \
    --admin-lastname=$ADMIN_LASTNAME \
    --admin-email=$ADMIN_EMAIL \
    --admin-user=admin \
    --admin-password=$ADMIN_PASSWORD \
    --language=en_US \
    --currency=$CURRENCY \
    --timezone=$TIMEZONE \
    --use-rewrites=1 \
    --search-engine=elasticsearch7 \
    --elasticsearch-host=elasticsearch \
    --elasticsearch-port=9200 \
    --elasticsearch-password=$ELATIC_PASSWORD \
    --elasticsearch-index-prefix=magento2 \
    --elasticsearch-timeout=15 \
    --deplop_mode=$APP_ENVIRONMENT \
    --cleanup-database
