PHP Classes

Laravel Docker Kubernetes: Run a Laravel project using Docker and Kubernetes

Recommend this page to a friend!

  Author Author  
Picture of Nahidul Hasan
Name: Nahidul Hasan <contact>
Classes: 6 packages by
Country: Bangladesh Bangladesh
Innovation award
Innovation award
Nominee: 4x


  Detailed description   Download Download .zip .tar.gz   Install with Composer Install with Composer  
This package can run a Laravel project using Docker and Kubernetes.

It provides an example project based on Laravel that that is ready to be deployed.

The package also provides configuration files to deploy the project using Docker and Kubernetes.

Details

Laravel-docker-kubernetes

From 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

Clone the project
 

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

docker-compose build

docker-compose up -d

Now browse project

 http://localhost:8083/

Deploy the project using Kubernetes

At first build image running the command:

docker build . -f ./deploy/dockerfile -t laravel:v4

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.

 docker login
 

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.

docker tag laravel:v4 docker.io/nahid35/laravel:v4

docker push docker.io/nahid35/laravel:v4

Now run minikube. Running the commands be sure that you have installed minikube. If not installed, you can get install instructions from this link

minikube start

Now run the following commands for deploying your project:


kubectl apply -f deploy/app/secret.yml

kubectl apply -f deploy/app/deploy.yml

kubectl apply -f deploy/app/service.yml


Now run the following commands to see minikube dashboard:

minikube dashboard

You will get this url :

http://192.168.99.100:30000/#!/overview?namespace=default

kubectl get svc

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 :

 http://192.168.99.100:32676/

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:

     base64 -b -i deploy/env/.env

> - 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.


  Classes of Nahidul Hasan  >  Laravel Docker Kubernetes  >  Download Download .zip .tar.gz  >  Support forum Support forum  >  Blog Blog (1)  >  RSS 1.0 feed RSS 2.0 feed Latest changes  
Name: Laravel Docker Kubernetes
Base name: laravel-docker-k8s
Description: Run a Laravel project using Docker and Kubernetes
Version: 1.0.0
PHP version: 5
License: The PHP License
 
  Groups   Applications   Files Files  

  Groups  
Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
Group folder image Libraries Frameworks and libraries of cooperating classes View top rated classes
Group folder image Project Management Tools to assist project management View top rated classes


  Innovation Award  
PHP Programming Innovation award nominee
March 2022
Nominee
Vote
Docker is a tool used in projects that need to deploy applications that may need to use multiple servers to run in a scalable way. Docker can deploy applications as containers.

Kubernetes is a system that can orchestrate the deployment of applications using multiple containers.

This package demonstrates how you can deploy a Laravel project combining the possibilities made available by Docker and Kubernetes.

Manuel Lemos

  Applications that use this package  
No pages of applications that use this class were specified.

Add link image If you know an application of this package, send a message to the author to add a link here.

  Files folder image Files  
File Role Description
Files folder imageapp (1 file, 4 directories)
Files folder imagebootstrap (2 files)
Files folder imageconfig (11 files)
Files folder imagedatabase (3 directories)
Files folder imagedeploy (5 files, 3 directories)
Files folder imagedocker (2 directories)
Files folder imagepublic (4 files, 2 directories)
Files folder imageresources (3 directories)
Files folder imageroutes (4 files)
Files folder imagetests (2 files, 2 directories)
Accessible without login Plain text file .dockerignore Data Auxiliary data
Accessible without login Plain text file .env.example Data Auxiliary data
Plain text file artisan Class Class source
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file docker-compose.yml Data Auxiliary data
Accessible without login Plain text file Dockerfile Data Auxiliary data
Accessible without login Plain text file entrypoint Data Auxiliary data
Accessible without login Plain text file local-volumes.yaml Data Auxiliary data
Accessible without login Plain text file mysql-deployment.yaml Data Auxiliary data
Accessible without login Plain text file package.json Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file push.sh Data Auxiliary data
Accessible without login Plain text file readme.md Doc. Documentation
Accessible without login Plain text file server.php Aux. Auxiliary script
Accessible without login Plain text file webpack.mix.js Data Auxiliary data

  Files folder image Files  /  app  
File Role Description
Files folder imageConsole (1 file)
Files folder imageExceptions (1 file)
Files folder imageHttp (1 file, 2 directories)
Files folder imageProviders (5 files)
  Plain text file User.php Class Class source

  Files folder image Files  /  app  /  Console  
File Role Description
  Plain text file Kernel.php Class Class source

  Files folder image Files  /  app  /  Exceptions  
File Role Description
  Plain text file Handler.php Class Class source

  Files folder image Files  /  app  /  Http  
File Role Description
Files folder imageControllers (3 files, 1 directory)
Files folder imageMiddleware (4 files)
  Plain text file Kernel.php Class Class source

  Files folder image Files  /  app  /  Http  /  Controllers  
File Role Description
Files folder imageAuth (4 files)
  Plain text file Controller.php Class Class source
  Plain text file HomeController.php Class Class source
  Plain text file OrderController.php Class Class source

  Files folder image Files  /  app  /  Http  /  Controllers  /  Auth  
File Role Description
  Plain text file ForgotPasswordController.php Class Class source
  Plain text file LoginController.php Class Class source
  Plain text file RegisterController.php Class Class source
  Plain text file ResetPasswordController.php Class Class source

  Files folder image Files  /  app  /  Http  /  Middleware  
File Role Description
  Plain text file EncryptCookies.php Class Class source
  Plain text file RedirectIfAuthenticated.php Class Class source
  Plain text file TrimStrings.php Class Class source
  Plain text file VerifyCsrfToken.php Class Class source

  Files folder image Files  /  app  /  Providers  
File Role Description
  Plain text file AppServiceProvider.php Class Class source
  Plain text file AuthServiceProvider.php Class Class source
  Plain text file BroadcastServiceProvider.php Class Class source
  Plain text file EventServiceProvider.php Class Class source
  Plain text file RouteServiceProvider.php Class Class source

  Files folder image Files  /  bootstrap  
File Role Description
  Plain text file app.php Class Class source
  Accessible without login Plain text file autoload.php Aux. Auxiliary script

  Files folder image Files  /  config  
File Role Description
  Plain text file app.php Class Class source
  Plain text file auth.php Class Class source
  Accessible without login Plain text file broadcasting.php Aux. Auxiliary script
  Accessible without login Plain text file cache.php Aux. Auxiliary script
  Accessible without login Plain text file database.php Aux. Auxiliary script
  Accessible without login Plain text file filesystems.php Aux. Auxiliary script
  Accessible without login Plain text file mail.php Aux. Auxiliary script
  Accessible without login Plain text file queue.php Aux. Auxiliary script
  Plain text file services.php Class Class source
  Accessible without login Plain text file session.php Aux. Auxiliary script
  Accessible without login Plain text file view.php Aux. Auxiliary script

  Files folder image Files  /  database  
File Role Description
Files folder imagefactories (1 file)
Files folder imagemigrations (2 files)
Files folder imageseeds (1 file)

  Files folder image Files  /  database  /  factories  
File Role Description
  Plain text file ModelFactory.php Class Class source

  Files folder image Files  /  database  /  migrations  
File Role Description
  Plain text file 2014_10_12_000000_create_users_table.php Class Class source
  Plain text file 2014_10_12_100000_...rd_resets_table.php Class Class source

  Files folder image Files  /  database  /  seeds  
File Role Description
  Plain text file DatabaseSeeder.php Class Class source

  Files folder image Files  /  deploy  
File Role Description
Files folder imageapp (5 files)
Files folder imagemysql (5 files)
Files folder imageredis (3 files)
  Accessible without login Plain text file deploy.conf Data Auxiliary data
  Accessible without login Plain text file dockerfile Data Auxiliary data
  Accessible without login Plain text file run Data Auxiliary data
  Accessible without login Plain text file supervisord.conf Data Auxiliary data
  Accessible without login Plain text file www.conf Data Auxiliary data

  Files folder image Files  /  deploy  /  app  
File Role Description
  Accessible without login Plain text file deploy.yml Data Auxiliary data
  Accessible without login Plain text file image-pull.yml Data Auxiliary data
  Accessible without login Plain text file namespace.json Data Auxiliary data
  Accessible without login Plain text file secret.yml Data Auxiliary data
  Accessible without login Plain text file service.yml Data Auxiliary data

  Files folder image Files  /  deploy  /  mysql  
File Role Description
  Accessible without login Plain text file gce-volume.yaml Data Auxiliary data
  Accessible without login Plain text file install.md Data Auxiliary data
  Accessible without login Plain text file mysql-deployment.yaml Data Auxiliary data
  Accessible without login Plain text file mysql-persistent-volume-claim.yml Data Auxiliary data
  Accessible without login Plain text file mysql-service.yaml Data Auxiliary data

  Files folder image Files  /  deploy  /  redis  
File Role Description
  Accessible without login Plain text file redis-master-deployment.yaml Data Auxiliary data
  Accessible without login Plain text file redis-service.yaml Data Auxiliary data
  Accessible without login Plain text file redis-slave-deployment.yaml Data Auxiliary data

  Files folder image Files  /  docker  
File Role Description
Files folder imagenginx (2 files)
Files folder imagephp (2 files)

  Files folder image Files  /  docker  /  nginx  
File Role Description
  Accessible without login Plain text file default.conf Data Auxiliary data
  Accessible without login Plain text file nginx.conf Data Auxiliary data

  Files folder image Files  /  docker  /  php  
File Role Description
  Accessible without login Plain text file custom.ini Data Auxiliary data
  Accessible without login Plain text file Dockerfile Data Auxiliary data

  Files folder image Files  /  public  
File Role Description
Files folder imagecss (1 file)
Files folder imagejs (1 file)
  Accessible without login Plain text file .htaccess Data Auxiliary data
  Plain text file index.php Class Class source
  Accessible without login Plain text file robots.txt Doc. Documentation
  Accessible without login Plain text file web.config Data Auxiliary data

  Files folder image Files  /  public  /  css  
File Role Description
  Accessible without login Plain text file app.css Data Auxiliary data

  Files folder image Files  /  public  /  js  
File Role Description
  Accessible without login Plain text file app.js Data Auxiliary data

  Files folder image Files  /  resources  
File Role Description
Files folder imageassets (2 directories)
Files folder imagelang (1 directory)
Files folder imageviews (2 files, 2 directories)

  Files folder image Files  /  resources  /  assets  
File Role Description
Files folder imagejs (2 files, 1 directory)
Files folder imagesass (2 files)

  Files folder image Files  /  resources  /  assets  /  js  
File Role Description
Files folder imagecomponents (1 file)
  Accessible without login Plain text file app.js Data Auxiliary data
  Accessible without login Plain text file bootstrap.js Data Auxiliary data

  Files folder image Files  /  resources  /  assets  /  js  /  components  
File Role Description
  Accessible without login Plain text file Example.vue Data Auxiliary data

  Files folder image Files  /  resources  /  assets  /  sass  
File Role Description
  Accessible without login Plain text file app.scss Data Auxiliary data
  Accessible without login Plain text file _variables.scss Data Auxiliary data

  Files folder image Files  /  resources  /  lang  
File Role Description
Files folder imageen (4 files)

  Files folder image Files  /  resources  /  lang  /  en  
File Role Description
  Accessible without login Plain text file auth.php Aux. Auxiliary script
  Accessible without login Plain text file pagination.php Aux. Auxiliary script
  Accessible without login Plain text file passwords.php Aux. Auxiliary script
  Accessible without login Plain text file validation.php Aux. Auxiliary script

  Files folder image Files  /  resources  /  views  
File Role Description
Files folder imageauth (2 files, 1 directory)
Files folder imagelayouts (1 file)
  Accessible without login Plain text file home.blade.php Aux. Auxiliary script
  Accessible without login Plain text file welcome.blade.php Aux. Auxiliary script

  Files folder image Files  /  resources  /  views  /  auth  
File Role Description
Files folder imagepasswords (2 files)
  Accessible without login Plain text file login.blade.php Aux. Auxiliary script
  Accessible without login Plain text file register.blade.php Aux. Auxiliary script

  Files folder image Files  /  resources  /  views  /  auth  /  passwords  
File Role Description
  Accessible without login Plain text file email.blade.php Aux. Auxiliary script
  Accessible without login Plain text file reset.blade.php Aux. Auxiliary script

  Files folder image Files  /  resources  /  views  /  layouts  
File Role Description
  Accessible without login Plain text file app.blade.php Aux. Auxiliary script

  Files folder image Files  /  routes  
File Role Description
  Accessible without login Plain text file api.php Example Example script
  Accessible without login Plain text file channels.php Example Example script
  Accessible without login Plain text file console.php Example Example script
  Accessible without login Plain text file web.php Example Example script

  Files folder image Files  /  tests  
File Role Description
Files folder imageFeature (1 file)
Files folder imageUnit (1 file)
  Plain text file CreatesApplication.php Class Class source
  Plain text file TestCase.php Class Class source

  Files folder image Files  /  tests  /  Feature  
File Role Description
  Plain text file ExampleTest.php Class Class source

  Files folder image Files  /  tests  /  Unit  
File Role Description
  Plain text file ExampleTest.php Class Class source

Install with Composer Install with Composer - Download Download all files: laravel-docker-k8s.tar.gz laravel-docker-k8s.zip
NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.
For more information send a message to info at phpclasses dot org.