Requirements:
- Docker
- Docker Compose
- bash shell (usually already installed)
- git
Note : All the following commands should be run as root
apt update
apt install -y curl git software-properties-common curl apt-transport-https ca-certificates gnupg tar
curl -sSL https://get.docker.com/ | CHANNEL=stable bash
And enable Docker on boot
systemctl enable --now docker && service docker start
mkdir -p /var/azuriom && cd /var/azuriom && git clone --depth 1 https://github.com/Azuriom/Azuriom.git .
chmod -R o+rw storage bootstrap/cache resources/themes plugins
chmod +x azuriom.sh
If the www-data
user doesn't exists, you need to add it (if an error tell your that this user already exists no worries, just skip it) :
useradd www-data
chown -R www-data:www-data /var/azuriom
Copy the .env.example
to .env
and set the database information like this:
DB_CONNECTION=mysql
DB_HOST=[IP adresse of your database. If you use a local database, set the public IP of your server (localhost or 127.0.0.1 won't work)]
DB_PORT=3306
DB_DATABASE=[database_name]
DB_USERNAME=[database_user]
DB_PASSWORD=[database_password]
DB_CONNECTION=pgsql
DB_HOST=database
DB_PORT=5432
DB_DATABASE=azuriom
DB_USERNAME=azuriom
DB_PASSWORD=[Here_A_Random_String]
./azuriom.sh build
php-fpm
needs to be started so others commands using it can run
./azuriom.sh start
./azuriom.sh laravel-generate-key
./azuriom.sh laravel-init-db
./azuriom.sh laravel-create-admin
crontab -l > cron
echo "* * * * * cd /var/azuriom && make artisan schedule:run >> /dev/null 2>&1" >> cron
crontab cron
rm cron
./azuriom.sh start
If you want to always start your container on a specific port, just add PORT=8080
to your .env
file
./azuriom.sh stop
git pull
./azuriom.sh build
./azuriom.sh laravel-clear-cache
./azuriom.sh laravel-migrate
Commands:
build Build the whole application.
start Start containers (require the whole application to be built)
docker-compose-build Build containers
npm-install Install npm dependencies
npm-run-prod Compile assets (require npm dependencies to be installed)
composer-install Install composer dependencies
laravel-generate-key Generate laravel APP_KEY in .env file (used by laravel for data encryption)
laravel-init-db Initiate database
laravel-migrate Run migration (mostly used when updating to insert database changes)
laravel-symlink Create a symlink (create a symlink public/storage -> storage/app/public)
laravel-create-admin Create an admin user through CLI
laravel-clear-cache Clear laravel cache
artisan <commands> Run any artisan command (e.g. ./azuriom artisan cache:clear)