chameeradin/doctor-c

Chameera Dinesh Kumara Loku Hewa Gamage

Web Designer
Web Developer
Ajax
Bootstrap
Laravel

Configuration

Required extensions:

Folder Permission Command

sudo chmod -R 777 storage/ sudo chmod -R 777 bootstrap/cache/

Artisan Commands

php artisan config:clear php artisan cache:clear php artisan view:clear php artisan module:optimize php artisan optimize composer dump-autoload
php artisan migrate php artisan db:seed php artisan migrate:refresh --seed (Re-run all the migrations and seeds(*dev only))

Update document root for virtual host

DocumentRoot <path_to_project>/public

Other configurations

Rename .env.example to .env and update credentials Run php artisan key:generate

Tests

To run full test suit "./vendor/bin/phpunit"

Setup domain

Add subdomain to Hosts file(The IP address should be same as the main site) 127.0.0.17 www.ervapp.local

Deployment

This project can be deployed in 2 ways.

Deployment Steps

That's it.....

Installation docker

First, update your existing list of packages: sudo apt update
Next, install a few prerequisite packages which let apt use packages over HTTPS: sudo apt install apt-transport-https ca-certificates curl software-properties-common
Then add the GPG key for the official Docker repository to your system: curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Add the Docker repository to APT sources: sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
Next, update the package database with the Docker packages from the newly added repo: sudo apt update
Make sure you are about to install from the Docker repo instead of the default Ubuntu repo: apt-cache policy docker-ce
You'll see output like this, although the version number for Docker may be different: docker-ce: Installed: (none) Candidate: 18.03.1~ce~3-0~ubuntu Version table: 18.03.1~ce~3-0~ubuntu 500 500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
Notice that docker-ce is not installed, but the candidate for installation is from the Docker repository for Ubuntu 18.04 (bionic).
Finally, install Docker: sudo apt install docker-ce
Docker should now be installed, the daemon started, and the process enabled to start on boot. Check that it's running: sudo systemctl status docker
#####Executing the Docker Command Without Sudo (Optional): By default, the docker command can only be run the root user or by a user in the docker group, which is automatically created during Docker's installation process. If you attempt to run the docker command without prefixing it with sudo or without being in the docker group, you'll get an output like this. docker: Cannot connect to the Docker daemon. Is the docker daemon running on this host?. See 'docker run --help'.
If you want to avoid typing sudo whenever you run the docker command, add your username to the docker group. sudo usermod -aG docker ${USER}
To apply the new group membership, log out of the server and back in, or type the following: su - ${USER}
Now you have succssfully installed the docker.To view all available subcommands, type: docker.
Then install the docker-compose: sudo apt install docker-compose
Test the docker-compose installation. docker-compose --version
#####Now you can up your site on docker containers by: Stop all other proceses running on port 80. Ex: If apache is running on port 80, you have to stop it before run the below command. docker-compose up -d
When you want run artisan command in project, do like below. docker-compose exec app php artisan migrate.
You have to add following entry to /etc/hosts file to load the laravel site and phpmyadmin. 127.0.0.1 ervapp.local pma.ervapp.local
To stop the containers you can run docker-compose kill. If you'd like to remove them all together, after stopping run docker-compose rm.
Partner With Chameera Dinesh Kumara
View Services

More Projects by Chameera Dinesh Kumara