All Projects → DevinY → Dlaravel

DevinY / Dlaravel

Licence: mit
Laravel and Docker

Programming Languages

shell
77523 projects

Projects that are alternatives of or similar to Dlaravel

Docker Stacks
DECK is a powerful and high performant local web development studio unlike any other.
Stars: ✭ 376 (+248.15%)
Mutual labels:  laravel, docker-compose
Laravel Boilerplate
Laravel Boilerplate / Starter Kit with Gentelella Admin Theme
Stars: ✭ 704 (+551.85%)
Mutual labels:  laravel, docker-compose
Docker Laravel
🐳 Build a simple laravel development environment with docker-compose.
Stars: ✭ 415 (+284.26%)
Mutual labels:  laravel, docker-compose
Lumen Microservice
Lumen on Docker - Skeleton project with Nginx, MySQL & PHP 7 | Aws ECS, Google Kubernates, Azure Container Engine
Stars: ✭ 183 (+69.44%)
Mutual labels:  laravel, docker-compose
Vessel
Up and running with small Docker environments
Stars: ✭ 1,006 (+831.48%)
Mutual labels:  laravel, docker-compose
Lnmp
💻 🐳 🐘 🐬 🐧 🚀 Start Docker LNMP(LEMP) In less than 2 minutes Powered by Docker Compose. 让 PHP 开发者快速(一键)搭建基于容器技术(Docker、Kubernetes)的开发、测试、生产(CI/CD by Drone)环境.
Stars: ✭ 341 (+215.74%)
Mutual labels:  laravel, docker-compose
Docker2saas
An open source tool that lets you create a SaaS website from docker images in 10 minutes.
Stars: ✭ 498 (+361.11%)
Mutual labels:  laravel, docker-compose
Ambientum
Docker native solution for running Laravel projects. From Development to Production
Stars: ✭ 487 (+350.93%)
Mutual labels:  laravel, docker-compose
Dockerized lara
Build your Laravel App with Redis - Mongodb - MariaDB - Nginx - php7 - zsh
Stars: ✭ 9 (-91.67%)
Mutual labels:  laravel, docker-compose
Ddev
DDEV-Local: a local PHP development environment system
Stars: ✭ 915 (+747.22%)
Mutual labels:  laravel, docker-compose
Larakube
Laravel app deployment for auto scaled Kubernetes cluster
Stars: ✭ 157 (+45.37%)
Mutual labels:  laravel, docker-compose
Porter
A docker based multi-site setup for local PHP development. Inspired by Laravel Valet, Homestead and Vessel.
Stars: ✭ 92 (-14.81%)
Mutual labels:  laravel, docker-compose
Laravel Docker K8s
Running Laravel project using Docker and Deploying using Kubernetes
Stars: ✭ 127 (+17.59%)
Mutual labels:  laravel, docker-compose
Stacker
Stacker - The environment for local web development, ready for use.
Stars: ✭ 356 (+229.63%)
Mutual labels:  laravel, docker-compose
Goodwork
Self hosted project management and collaboration tool powered by TALL stack
Stars: ✭ 1,730 (+1501.85%)
Mutual labels:  laravel, docker-compose
Laravel Docker Elasticsearch
This is a simple repo for practicing elasticsearch with laravel and docker.
Stars: ✭ 18 (-83.33%)
Mutual labels:  laravel, docker-compose
Rubel
Rubel is a cms built with Laravel and React.
Stars: ✭ 70 (-35.19%)
Mutual labels:  laravel, docker-compose
Docker Laravel
🐳 Docker Images for Laravel development
Stars: ✭ 101 (-6.48%)
Mutual labels:  laravel, docker-compose
Llum
Llum (light in catalan language) illuminates your Laravel projects speeding up your Github/Laravel development workflow
Stars: ✭ 107 (-0.93%)
Mutual labels:  laravel
Awesome Laravel
A curated list of bookmarks, packages, tutorials, videos and other cool resources from the Laravel ecosystem
Stars: ✭ 10,643 (+9754.63%)
Mutual labels:  laravel

中文說明

D-Laravel (English manual)

D-Laravel uses docker-composer micro service framework,

it helps you quickly to build basic Laravel development environment by using simple commands: console and create.

Using D-Laravel also means no longer to install mysql, nginx and php-fpm in Mac.

You can deploy the environment by self-defined docker-compose-custom.yml file.

Why use D-Laravel

It Provides easy way to execute the docker-compose command, quickly generate a laravel project environment, and automatically build a database and adjust Laravel's .env database settings for you.

The sublime3 package of D-Laravel alias can be installed, and the artisan and composer commands in the container (MacOS and Linux environment) are executed via sublime.

You can execute the latest PHP version in Mac OS.

It helps you to generate self-signed certification and completes HTTPS setting.

No need to install DnsMasq.

Port 80 won't be used when not start dlaravel.

Initial speed in seconds!!!

It can simulate different DB environment.

It also could open kinds of testing hosts.

Easy docker-compose v3.6 setting.

Using Dockerhub to remark official image to build basic Laravel environment.

It seems fashion if use docker. :P

./console help (help, console parameter)
./create test1  (build test1.test)
./console down or ./console up (stop or start container)
./console restart    (first ./console down and then ./console up)
`./console alias`  
(If you think ./console command is too log, you could create c alias in terminal which simplifies command to "c info", "c up", or "c down")
./console alias (print console alias samples, it can be added to .bashrc or .zshrc)   
./console version

Generate self-signed certificate for all current projects. (MacOS and Linux)
./console secure

Main Directory structure

etc/   (nginx、php.ini and mysql settings)
data/  (mysql data files, auto-generated by ./console up)
dockerfiles/ (some dockerfiles)
sites/ (project files, the project will be set in this folder when executes ./create test1)
create (Simplified bash, to fast build laravel project) 
console (Simplified bash file, to use kinds of docker-compose commands. ex. login mysql by "./console mysql")
docker-compose.yml (A soft link to connect different settings. ex. linking to docker-compose-custom.yml by "./console custom") 

1. Please install docker.

Mac OS:
https://docs.docker.com/docker-for-mac/

Ubuntu:
https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#install-docker-ce

Windows 10: (required for laravel install in gitbash!!)
https://docs.docker.com/docker-for-windows/install/

To run console and create bash on Windows 10:
Gitbash is required.
Laravel installer have to run correctly in gitbash also.

2. git clone D-Laravel repo and execute "./console pull" in the folder

git clone https://github.com/DevinY/dlaravel.git
cd dlaravel


You can ignore below's pull command. It will auto download the images according to docker-compose.yml when initials.
./console pull
The first time to download needed images from dockhub will take longer time. Be patient. :P

3. execute "./create ['project name']" to biuild new project

ex.
./create test1
It will build http://test1.test website (can't be accessed from outside)
So you can use this command to build many different projects.

You need to provide privilege to modify /etc/hosts file, so D-Laravel will ask for your systme password during executing "./create project". (Mac OS using only)

4. executing "./console down" in D-Laravel foldee

Attention:
D-Laravel is only used for development, Mysql root password is empty.
You may need to revise TZ in docker-compose.yml, default is Asia/Taipei.

5. Updating D-Laravel bash program and some settings

git pull

.gitignore in D-Laravel already excludes dynamic files, ex. docker-comnpose.yml, docker-compose-custom.yml, sites folder etc.
You can git pull latest version and setting in D-Laravel folder.

6. alias and function (without entering the container can be implemented within the container composer or artisan instructions)

Get the console alias in your system.

 ./console alias

And then add the output to your ~/.bash_profile, or ~/.zshrc if you are using Z shell. The OS X won't create .bash_profile for you. Type 'touch ~/.bash_profile' to create your new one.

Execute the laravel installer in the container using the identity of dlaravel

alias laravel='docker-compose exec -u dlaravel php /home/dlaravel/.composer/vendor/bin/laravel'

run composer.sh in project folder, for example: ce dump

alias ce="../../composer.sh"

We can add aliases to our computer so that you do not have to go into the container to execute the php artisan directive. Let artisan's instructions be more concise, which I call the alias directly as a. For example: a --version

alias a="../../artisan.sh"
alias phpunit = 'docker-compose -f ../../docker-compose.yml exec -u dlaravel php $ (basename $ {PWD}) / vendor / bin / phpunit -c $ (basename $ {PWD}) / phpunit.xml '

Join this alias can do simple phpunit.

Others

./create [project name] will create and build laravel, it would set all configures automatically including DB.
But how do we do if project already exists and only needs nginx setting?

Using "--host" to update /etc/hosts file, for example: "127.0.0.1 project1.test". 
./create --host [project name] (./create --host project1)


You can move exist Laravel project to D-Laravel site folder.

Or manually executes "composer create-project" (not default version etc.) 

Ex. Create project manually by using lumen
./console exec  //It can execute php command in container.

./console exec php composer create-project --prefer-dist laravel/lumen project1

Adjust images in setting

PHP: Official repository rebuilds php to fit Laravel environment

 image: deviny/fpm:7.3.5
 image: deviny/fpm:7.2.18
 image: deviny/fpm:7.1.29
 image: deviny/fpm:5.6.39

Nginx: OFFICIAL REPOSITORY

Mysql: OFFICIAL REPOSITORY

Remark: When you need to revise different mysql version and that D-Laravel/data already exist, you may need to reset DB name in D-Laravel.data to ensure mysql image works normally.

Ex. Rename data to data_mysql8

db:
  image: mysql:8
  ...
  volumes:
      - ./etc/mysql/my.cnf:/etc/mysql/my.cnf
      - ./data_mysql8:/var/lib/mysql

Advandace

If you would like to rebuild your own php-fpm image. You can do as below:

cd dockerfiles/fpm/7.3
docker build -t myfpm .

And then edit Your docker-compose.yml file.

 php:
  network_mode: "service:web"
  image: myfpm

Docker commands and Devin/dlaravel "./console" bash command comparison table

Docker official commands simplified ./console Bash commands Describtion
docker-compose pull ./console pull pull latest images
docker-compose up -d ./console up start container
docker-compose down ./console down stop container
docker-compose ps or docker ps ./console ps show docker-compose process
docker-compose exec -u dlaravel php bash ./console access php container
docker-compose exec php command ./console exec command execute php container command,ex. ./console exec php -v
docker-compose exec db mysql ./console mysql exectue mysql
docker-compose exec web nginx -s reload ./console reload reload nginx setting
docker-compose logs -f [SERVICE] ./console logs show nginx log,stop it with Ctrl+C
./create [ProjectName] create a project with default settings
Ex. ./create test1 Ex. create a http://test1.test website
./console restart restart container
./console info show url info
Switch model:
./console random using random port when initiate container
./console normal using local port 80 and 127.0.0.1:3306
./console custom using self-defined docker-compose-custom.yml
command below: -f: specific docker-compose.yml path。 up -d:start container in background
docker-compose -f docker-compose-normal.yml up -d using port 80 and port 3306
docker-compose -f docker-compose-random.yml up -d specific yml file with random port
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].