diff --git a/.docker-config/php/Dockerfile b/.docker-config/php/Dockerfile index 3896cfd..b897029 100755 --- a/.docker-config/php/Dockerfile +++ b/.docker-config/php/Dockerfile @@ -12,6 +12,8 @@ RUN chmod a+x run_queue.sh \ chown -R www-data:www-data /var/www/project COPY ./composer_install.sh . RUN chmod a+x composer_install.sh +COPY ./banner_message.sh . +RUN chmod a+x banner_message.sh WORKDIR /var/www/project diff --git a/.docker-config/php/banner_message.sh b/.docker-config/php/banner_message.sh new file mode 100755 index 0000000..f6dbc33 --- /dev/null +++ b/.docker-config/php/banner_message.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +# Banner Message shell script +# +# Display a banner message to let the user know the environment is ready for use +# +# @author nystudio107 +# @copyright Copyright (c) 2023 nystudio107 +# @link https://nystudio107.com/ +# @license MIT + +# Rewrite the PRIMARY_SITE_URL env var if we're running in Codespaces +if [[ ! ${CODESPACES:-"unset"} == "unset" ]]; then + export PRIMARY_SITE_URL="https://${CODESPACE_NAME}-${DEV_SERVER_PORT}.preview.app.github.dev/" +fi +# Banner message +sleep 1 +echo "### Your Craft site is ready!" +echo "Frontend URL: ${PRIMARY_SITE_URL}" +echo "CP URL: ${PRIMARY_SITE_URL}admin" +echo "CP User: ${CRAFT_CP_USER}" +echo "CP Password: ${CRAFT_CP_PASSWORD}"