Recommend this page to a friend! |
Classes of Nahidul Hasan | Laravel Docker Kubernetes | readme.md | Download |
|
Download
Laravel-docker-kubernetesFrom here you will be able to know that how you will run your Laravel project using Docker and how you will deploy using Kubernetes(minikube) Run the project using docker
Now run the following command from your terminal one by one. Running the commands be sure that you have installed docker.You will get install instructions from this link
Now browse project
Deploy the project using KubernetesAt first build image running the command:
Now login in docker hub. Running the command be sure that you have created an account in docker hub. If not go to the link and create account.
Now run the following command for Pushing image in docker registry.In the command nahid35 is my docker id and laravel is repository name and v4 is tag name. Modify command according to your docker id, repository name and tag name.
Now run minikube. Running the commands be sure that you have installed minikube. If not installed, you can get install instructions from this link
Now run the following commands for deploying your project:
Now run the following commands to see minikube dashboard:
You will get this url :
Running above command you will get following information: NAME | TYPE | CLUSTER-IP | EXTERNAL-IP | PORT(S) | AGE ---------|---------------|-----------------|----------------|------------|---------- kubernetes | ClusterIP | 10.0.0.1 | <none> | 443/TCP | 27d laravel-api | LoadBalancer | 10.0.0.11 | <pending> | 80:32676/TCP | 4m Now you can browse your project using following url :
Extra Note :> - If you want to use different database or different port etc, You have to change in the docker-compose.yml file. > - If you modify .env file, You have to run following command:
> - Running the command you will get base 64 encoded string. Put the string in deploy\app\secret.yml. And then run the commands for deploying. |