Build modified streamline images

The official image from streamline does not currently work for the arm64
platform. As a temporary measure, the source code and docker build scripts
have been lifted from the official images and are used to build locally.

Some additional modifications are made to reduce overall image size, these
are documented in docker/README.md
This commit is contained in:
2024-03-10 16:17:50 -07:00
parent 2ffc3c408a
commit a424394109
13506 changed files with 1860172 additions and 6 deletions
+54
View File
@@ -0,0 +1,54 @@
#! /bin/sh
# Required script variables
APP_NAME=${APP_NAME:-'streamline'}
export MYSQL_DATABASE=${DB_DATABASE:-'streamline'}
export MYSQL_USER=${DB_USERNAME:-'root'}
export MYSQL_PASSWORD=${DB_PASSWORD:-'streamline'}
export MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD:-'streamline'}
# execute run.sh script for MySQL initialisation
chmod +x .docker/mysql/mysql-init.sh
# run the MariaDB initilisation script
./.docker/mysql/mysql-init.sh
if [ $? -eq 0 ]; then
echo "[info] MySQL server started. checking for '$MYSQL_DATABASE' database. "
mysql -u $MYSQL_USER -p$MYSQL_PASSWORD -e "use streamline;"
# Guard condition to re-check existence of database schema
# If it doesnt exist, create it and import streamline_initial.sql file
if [ $? -eq 1 ]; then
mysql -u $MYSQL_USER -p$MYSQL_PASSWORD -e "CREATE DATABASE $MYSQL_DATABASE;"
if [ $? -eq 0 ]; then
echo "[info] Database: $MYSQL_DATABASE created."
mysql -u $MYSQL_USER -p$MYSQL_PASSWORD $MYSQL_DATABASE < ./.docker/mysql/scripts/streamline_initial.sql
if [ $? -eq 0 ]; then
echo "[info] populated database."
else
echo "[error] database not populated."
fi
else
echo "[error] database not created."
fi
else
echo "[info] Database: $MYSQL_DATABASE exists. "
fi
echo "[info] starting $APP_NAME ..."
php /var/www/html/artisan serve --host=0.0.0.0 --port=80
else
echo "[error] MariaDB server couldnt be started."
# terminate script if database isnt running
exit 1;
fi