Recommend this page to a friend! |
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)
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/
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/
> - 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 .zip .tar.gz | > | Support forum | > | Blog (1) | > | Latest changes |
|
Groups | Applications | Files |
Groups |
PHP 5 | Classes using PHP 5 specific features | View top rated classes |
Libraries | Frameworks and libraries of cooperating classes | View top rated classes |
Project Management | Tools to assist project management | View top rated classes |
Innovation Award |
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 |
If you know an application of this package, send a message to the author to add a link here.
Files |
File | Role | Description | ||
---|---|---|---|---|
app (1 file, 4 directories) | ||||
bootstrap (2 files) | ||||
config (11 files) | ||||
database (3 directories) | ||||
deploy (5 files, 3 directories) | ||||
docker (2 directories) | ||||
public (4 files, 2 directories) | ||||
resources (3 directories) | ||||
routes (4 files) | ||||
tests (2 files, 2 directories) | ||||
.dockerignore | Data | Auxiliary data | ||
.env.example | Data | Auxiliary data | ||
artisan | Class | Class source | ||
composer.json | Data | Auxiliary data | ||
composer.lock | Data | Auxiliary data | ||
docker-compose.yml | Data | Auxiliary data | ||
Dockerfile | Data | Auxiliary data | ||
entrypoint | Data | Auxiliary data | ||
local-volumes.yaml | Data | Auxiliary data | ||
mysql-deployment.yaml | Data | Auxiliary data | ||
package.json | Data | Auxiliary data | ||
phpunit.xml | Data | Auxiliary data | ||
push.sh | Data | Auxiliary data | ||
readme.md | Doc. | Documentation | ||
server.php | Aux. | Auxiliary script | ||
webpack.mix.js | Data | Auxiliary data |
Files | / | app |
File | Role | Description | ||
---|---|---|---|---|
Console (1 file) | ||||
Exceptions (1 file) | ||||
Http (1 file, 2 directories) | ||||
Providers (5 files) | ||||
User.php | Class | Class source |
Files | / | app | / | Http |
File | Role | Description | ||
---|---|---|---|---|
Controllers (3 files, 1 directory) | ||||
Middleware (4 files) | ||||
Kernel.php | Class | Class source |
Files | / | app | / | Http | / | Controllers |
File | Role | Description | ||
---|---|---|---|---|
Auth (4 files) | ||||
Controller.php | Class | Class source | ||
HomeController.php | Class | Class source | ||
OrderController.php | Class | Class source |
Files | / | app | / | Http | / | Controllers | / | Auth |
File | Role | Description |
---|---|---|
ForgotPasswordController.php | Class | Class source |
LoginController.php | Class | Class source |
RegisterController.php | Class | Class source |
ResetPasswordController.php | Class | Class source |
Files | / | app | / | Http | / | Middleware |
File | Role | Description |
---|---|---|
EncryptCookies.php | Class | Class source |
RedirectIfAuthenticated.php | Class | Class source |
TrimStrings.php | Class | Class source |
VerifyCsrfToken.php | Class | Class source |
Files | / | app | / | Providers |
File | Role | Description |
---|---|---|
AppServiceProvider.php | Class | Class source |
AuthServiceProvider.php | Class | Class source |
BroadcastServiceProvider.php | Class | Class source |
EventServiceProvider.php | Class | Class source |
RouteServiceProvider.php | Class | Class source |
Files | / | bootstrap |
File | Role | Description |
---|---|---|
app.php | Class | Class source |
autoload.php | Aux. | Auxiliary script |
Files | / | config |
File | Role | Description |
---|---|---|
app.php | Class | Class source |
auth.php | Class | Class source |
broadcasting.php | Aux. | Auxiliary script |
cache.php | Aux. | Auxiliary script |
database.php | Aux. | Auxiliary script |
filesystems.php | Aux. | Auxiliary script |
mail.php | Aux. | Auxiliary script |
queue.php | Aux. | Auxiliary script |
services.php | Class | Class source |
session.php | Aux. | Auxiliary script |
view.php | Aux. | Auxiliary script |
Files | / | database | / | migrations |
File | Role | Description |
---|---|---|
2014_10_12_000000_create_users_table.php | Class | Class source |
2014_10_12_100000_...rd_resets_table.php | Class | Class source |
Files | / | deploy |
File | Role | Description | ||
---|---|---|---|---|
app (5 files) | ||||
mysql (5 files) | ||||
redis (3 files) | ||||
deploy.conf | Data | Auxiliary data | ||
dockerfile | Data | Auxiliary data | ||
run | Data | Auxiliary data | ||
supervisord.conf | Data | Auxiliary data | ||
www.conf | Data | Auxiliary data |
Files | / | deploy | / | app |
File | Role | Description |
---|---|---|
deploy.yml | Data | Auxiliary data |
image-pull.yml | Data | Auxiliary data |
namespace.json | Data | Auxiliary data |
secret.yml | Data | Auxiliary data |
service.yml | Data | Auxiliary data |
Files | / | deploy | / | mysql |
File | Role | Description |
---|---|---|
gce-volume.yaml | Data | Auxiliary data |
install.md | Data | Auxiliary data |
mysql-deployment.yaml | Data | Auxiliary data |
mysql-persistent-volume-claim.yml | Data | Auxiliary data |
mysql-service.yaml | Data | Auxiliary data |
Files | / | deploy | / | redis |
File | Role | Description |
---|---|---|
redis-master-deployment.yaml | Data | Auxiliary data |
redis-service.yaml | Data | Auxiliary data |
redis-slave-deployment.yaml | Data | Auxiliary data |
Files | / | docker | / | nginx |
File | Role | Description |
---|---|---|
default.conf | Data | Auxiliary data |
nginx.conf | Data | Auxiliary data |
Files | / | docker | / | php |
File | Role | Description |
---|---|---|
custom.ini | Data | Auxiliary data |
Dockerfile | Data | Auxiliary data |
Files | / | public |
File | Role | Description | ||
---|---|---|---|---|
css (1 file) | ||||
js (1 file) | ||||
.htaccess | Data | Auxiliary data | ||
index.php | Class | Class source | ||
robots.txt | Doc. | Documentation | ||
web.config | Data | Auxiliary data |
Files | / | resources |
Files | / | resources | / | assets | / | js |
File | Role | Description | ||
---|---|---|---|---|
components (1 file) | ||||
app.js | Data | Auxiliary data | ||
bootstrap.js | Data | Auxiliary data |
Files | / | resources | / | assets | / | sass |
File | Role | Description |
---|---|---|
app.scss | Data | Auxiliary data |
_variables.scss | Data | Auxiliary data |
Files | / | resources | / | lang | / | en |
File | Role | Description |
---|---|---|
auth.php | Aux. | Auxiliary script |
pagination.php | Aux. | Auxiliary script |
passwords.php | Aux. | Auxiliary script |
validation.php | Aux. | Auxiliary script |
Files | / | resources | / | views |
File | Role | Description | ||
---|---|---|---|---|
auth (2 files, 1 directory) | ||||
layouts (1 file) | ||||
home.blade.php | Aux. | Auxiliary script | ||
welcome.blade.php | Aux. | Auxiliary script |
Files | / | resources | / | views | / | auth |
File | Role | Description | ||
---|---|---|---|---|
passwords (2 files) | ||||
login.blade.php | Aux. | Auxiliary script | ||
register.blade.php | Aux. | Auxiliary script |
Files | / | resources | / | views | / | auth | / | passwords |
File | Role | Description |
---|---|---|
email.blade.php | Aux. | Auxiliary script |
reset.blade.php | Aux. | Auxiliary script |
Files | / | routes |
File | Role | Description |
---|---|---|
api.php | Example | Example script |
channels.php | Example | Example script |
console.php | Example | Example script |
web.php | Example | Example script |
Files | / | tests |
File | Role | Description | ||
---|---|---|---|---|
Feature (1 file) | ||||
Unit (1 file) | ||||
CreatesApplication.php | Class | Class source | ||
TestCase.php | Class | Class source |
Install with Composer - 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.
|