Deploy Laravel Based Application to Awanio

Before deploying PHP applications with the Laravel framework, there are a number of things that you must prepare, namely:

  • Awanio account
  • ssh public key that has been registered on the Awanio dashboard page
  • git url endpoint to be used for push code. The format is git@awan.io:TEAM/APP_NAME.git
  • awan.yml file that is placed in the top application folder

Creating the Application

To create an application, please go to the "Applications" menu in the top right hand side of the page, click the "Create Application" button. After that the display will appear as follows:

Then fill in the environment variable information needed to run the Laravel application. Here is an example:

After that in your Laravel application folder, add awan.yaml file with the following contents:

version: '1.0'
web:
  type: php
  version: 7.3
  doc_root: ./public
  package_manager: composer
  run: php artisan migrate --force & php artisan queue:work & apache2-foreground

Please note, make sure the apache2-foreground command is always at the end of all worker commands.

After the Laravel application is ready, add the Gwan Remote Awanio to the project:

git remote add awan git@awan.io:TEAM/APP_NAME.git

After that, please commit and push to the git server to Awanio

git push awan master

After the deployment is complete, please check your application at https://app-name.diawan.id

htaccess file

Awanio uses Apache Httpd as a runtime for PHP-based applications. Thus, you can add the .htaccess file to the public folder in the Laravel application.

For more details, please refer to the following video.