All Projects → eleftrik → laradhoc

eleftrik / laradhoc

Licence: MIT license
Laradhoc is a Docker-based basic LEMP development environment designed for Laravel applications.

Programming Languages

shell
77523 projects
Dockerfile
14818 projects

Projects that are alternatives of or similar to laradhoc

Webinoly
Optimized LEMP Web Server to manage your WordPress, PHP, or simple HTML sites running on a powerful NGINX setup.
Stars: ✭ 254 (+209.76%)
Mutual labels:  lemp
Centminmod
CentOS Shell menu based Nginx LEMP web stack auto installer (GPLv3 licensed)
Stars: ✭ 519 (+532.93%)
Mutual labels:  lemp
Lnmp
LNMP一键安装包是一个用Linux Shell编写的可以为CentOS/RHEL/Fedora/Aliyun/Amazon、Debian/Ubuntu/Raspbian/Deepin/Mint Linux VPS或独立主机安装LNMP(Nginx/MySQL/PHP)、LNMPA(Nginx/MySQL/PHP/Apache)、LAMP(Apache/MySQL/PHP)生产环境的Shell程序。
Stars: ✭ 2,119 (+2484.15%)
Mutual labels:  lemp
Ansible Playbooks
Playbooks for automating server procedures based on our Community guides
Stars: ✭ 285 (+247.56%)
Mutual labels:  lemp
Cipi
An Open Source Control Panel for your Cloud! Deploy and manage LEMP apps in one click!
Stars: ✭ 376 (+358.54%)
Mutual labels:  lemp
Docker Lemp
🐳 Docker 快速搭建 LEMP 开发环境
Stars: ✭ 87 (+6.1%)
Mutual labels:  lemp
k8s-lemp
LEMP stack in a Kubernetes cluster
Stars: ✭ 74 (-9.76%)
Mutual labels:  lemp
anstead
Ansible playbook for Laravel
Stars: ✭ 14 (-82.93%)
Mutual labels:  lemp
Ansible Role Php
Ansible Role - PHP
Stars: ✭ 396 (+382.93%)
Mutual labels:  lemp
Oneinstack
OneinStack - A PHP/JAVA Deployment Tool
Stars: ✭ 1,983 (+2318.29%)
Mutual labels:  lemp
Slickstack
SlickStack is a free LEMP stack automation script written in Bash designed to enhance and simplify WordPress provisioning, performance, and security.
Stars: ✭ 311 (+279.27%)
Mutual labels:  lemp
Lnmp
💻 🐳 🐘 🐬 🐧 🚀 Start Docker LNMP(LEMP) In less than 2 minutes Powered by Docker Compose. 让 PHP 开发者快速(一键)搭建基于容器技术(Docker、Kubernetes)的开发、测试、生产(CI/CD by Drone)环境.
Stars: ✭ 341 (+315.85%)
Mutual labels:  lemp
Docker Nginx Php Mysql
Docker running Nginx, PHP-FPM, MySQL & PHPMyAdmin
Stars: ✭ 1,322 (+1512.2%)
Mutual labels:  lemp
Yclas
Yclas Self Hosted is a powerful script that can transform any domain into a fully customizable classifieds site within a few seconds.
Stars: ✭ 276 (+236.59%)
Mutual labels:  lemp
Lnmp
LEMP stack/LAMP stack/LNMP stack installation scripts for CentOS/Redhat Debian and Ubuntu
Stars: ✭ 2,488 (+2934.15%)
Mutual labels:  lemp
docker-compose-lemp-stack
Docker Compose Linux Nginx MariaDB PHP7.2 Stack
Stars: ✭ 55 (-32.93%)
Mutual labels:  lemp
Wordops
Install and manage a high performance WordPress stack with a few keystrokes
Stars: ✭ 649 (+691.46%)
Mutual labels:  lemp
docker-php-lemp
A dockerized php lemp stack
Stars: ✭ 15 (-81.71%)
Mutual labels:  lemp
LEMPer
LEMPer Stack is terminal-based LEMP / LNMP installer and manager for Debian & Ubuntu cloud or virtual server (vps) and on-premise (bare metal).
Stars: ✭ 171 (+108.54%)
Mutual labels:  lemp
Ecsharp
Home of LoycCore, the LES language of Loyc trees, the Enhanced C# parser, the LeMP macro preprocessor, and the LLLPG parser generator.
Stars: ✭ 141 (+71.95%)
Mutual labels:  lemp

Laradhoc

Laradhoc

GitHub stars GitHub watchers GitHub issues GitHub GitHub tag (latest by date)

🆕 Version 2.3.0 is out - PHP 8.1 support

Laradhoc is a Docker-based basic LEMP development environment designed for Laravel applications.

Looking for a similar Docker environment for WordPress? Then give a try to Dockpress!

Preferisci leggere in italiano? 🇮🇹

Features

  • Nginx
  • PHP (7.2 / 7.3 / 7.4 / 8.0 / 8.1) with OPCache
  • Composer 2.0
  • MySQL / MariaDB
  • MongoDB
  • phpMyAdmin
  • Mailhog
  • Redis
  • Custom domain name (es. http://laradhoc.test or https://laradhoc.test)
  • HTTP or HTTPS (with self-signed SSL certificate)
  • npm
  • gulp (for old projects)

You can choose which version of PHP (for example, 7.4) to run by setting $PHP_VERSION variable in your .env file (see .env.example for details).

Likewise, you can choose your database (for example, MariaDB 10.2) by setting $DATABASE_IMAGE variable in your .env file (see .env.example for details)

In case you want to customize your Docker configuration (e.g. adding some mount), just run cp docker-compose.yml docker-compose.override.yml then edit your docker-compose.override.yml. It will be used by Docker.

Requirements

  • MacOS, Linux or Windows with WSL
  • Docker
  • openssl (when using HTTPS)

Installation

Just clone this repo.

Let's pretend your Laravel application will be accessible at laradhoc.test:

git clone [email protected]:eleftrik/laradhoc.git laradhoc.test
cd laradhoc.test

laradhoc command

Before version 2.1.0, you had to

  • cd into Laradhoc folder
  • invoke ./bin/laradhoc

Starting from version 2.1.0, you can invoke laradhoc no matter which folder you're in.

Tip If you want to invoke laradhoc command when you're into your Laravel folder, define an alias alias laradhoc='../bin/laradhoc' (e.g. in your .bashrc file).

In this way, when you're using your terminal in the root folder of you Laravel project, you can simply type laradhoc ( as if the binary were in the same folder).

Configuration

.env

Create an .env file from .env.example

cp .env.example .env

# Customize every variable according to your needs
# See comments to each variable in .env.example file

Custom domain

According to the value of ${APP_HOST}, add your test domain (e.g. laradhoc.test) to your hosts file

sudo /bin/bash -c 'echo -e "127.0.0.1 laradhoc.test" >> /etc/hosts'

HTTPS

Choose if you want to run your application over HTTP or HTTPS.

  • HTTPS: set NGINX_ENABLE_HTTPS=1
  • HTTP: set NGINX_ENABLE_HTTPS=0

With HTTPS enabled, a self-signed SSL certificate will be generate.

Under .docker/images/nginx/ssl you will find

  • ${APP_HOST}.test.crt
  • ${APP_HOST}.test.key

NOTE: you need to import/install the .crt file so it will be trusted by your operating system / browser.

Let's go

Build all Docker containers and start them

 ./bin/laradhoc init

Ok, let's talk now about your Laravel application!

New or existing?

a. New application

New Laravel project from scratch? No problem, just run:

./bin/laradhoc install-laravel

A fresh Laravel app will be downloaded in ${APP_SRC}, configured and available at http://${APP_HOST} or https://${APP_HOST}

b. Existing application

Do you have an existing Laravel Project?

Just copy it or clone it into ${APP_SRC} so your Laravel application is inside that directory.

Then run:

./bin/laradhoc init-laravel

Laradhoc will search for an .env file (if not found, it will try to copy .env.example). Then, it will update your Laravel .env with the values taken from the main .env file. After this, it will install Composer dependencies and a key will be generated by the usual Artisan command.


Remember to run manually your migrations / seeds:

./bin/laradhoc artisan migrate --seed

Do whatever your Laravel application needs to run correctly. For example:

  • ./bin/laradhoc artisan passport:install --force
  • ./bin/laradhoc node npm install && ./bin/laradhoc node npm run dev
  • etc.

Finished working? Just stop everything:

./bin/laradhoc stop

Next time you need to run your application, if you haven't changed any setting, just run

./bin/laradhoc 

Please note Nginx will proxy all request from socket.io to laravel-echo container.

Updates

When updating from a previous version, follow these steps:

  • update your code

    • via git pull if you're still referencing this repository, a fork or a private one
    • manually downloading the desired release

    In both cases, the src/ folder won't be affected

  • see CHANGELOG.md

  • update your ./.env file according to ./.env.example (new variables may have been introduced)

  • if you have overridden docker-compose.yml using docker-compose.override.yml, see docker-compose.yml to check if something has added, changed or deleted, compared to the previous version of docker-compose.yml you were using before updating

  • launch ./bin/laradhoc start --build

Scripts

Laradhoc provides some useful scripts, located in .docker/scripts.

Run them from your Laradhoc base folder.

init

./bin/laradhoc init

It will

  • check openssl is installed on your host machine (if you set NGINX_ENABLE_HTTPS=1)
  • create a self-signed certificate (if you set NGINX_ENABLE_HTTPS=1)
  • build and start the containers

start | up

./bin/laradhoc start

or

./bin/laradhoc up

It's a shortcut to

docker-compose up -d

build

If you want to (re)build the images, use

./bin/laradhoc build

stop | down

Tired of working? Stop the environment

./bin/laradhoc stop

or

./bin/laradhoc down

install-laravel

It's useful to bring up a new Laravel project. It will prepare a fresh Laravel app in your ${APP_SRC}, create a ${APP_SRC}/.env file holding the same values which are in the main .env file

./bin/laradhoc install-laravel

init-laravel

Update the Laravel .env with the environment values coming from the main .env file

./bin/laradhoc init-laravel

artisan

It will execute an artisan command inside the php-fpm container. For example:

./bin/laradhoc artisan make:migration create_example_table

composer

It will execute a composer command through the composer container. For example:

./bin/laradhoc composer install

node

It will execute commands through the node container. For example:

./bin/laradhoc node yarn run production

gulp

Need to run some "old" project still using gulp? No problem: this command will run Gulp and compile your assets.

For example:

./bin/laradhoc gulp watch

test

This command will execute PHPUnit tests:

./bin/laradhoc test

ps

This command will show running containers, according to docker-compose file:

./bin/laradhoc ps

It's a shortcut to

docker-compose ps

nah

Want to throw away anything? This command will stop all containers, delete volumes and the entire $APP_SRC.

So, before executing this command, BE SURE you understood very well that you're going to lose all your Laravel codebase and the related database!

./bin/laradhoc nah

To throw away anything and start again from the scratch, use

./bin/laradhoc nah && ./bin/laradhoc init && ./bin/laradhoc laravel-install

help

This command will show a quick help, listing all available commands:

./bin/laradhoc help

Accessing MySQL/MariaDB database

Via phpMyAdmin

You can use phpMyAdmin: http://${APP_HOST}:${PHPMYADMIN_PORT}

For example: http://laradhoc.test:8080

Via client

You can connect to your database via command line or using a tool.

For example, from the command line:

source .env
mysql -u$MYSQL_USER -p$MYSQL_PASSWORD -h127.0.0.1 $MYSQL_DATABASE

I bet you prefer to use your favorite tool, for example:

  • TablePlus
  • SequelPro
  • HeidiSQL

etc.

Just use the parameters stored in your .env file.

Accessing MongoDB

MongoDB is listening on port 27017.

In the following examples, of course you have to replace user, password and laradhoc with the current values of your MONGODB_USER, MONGODB_PASSWORD and MONGODB_DATABASE environment variables.

If in your host you did install mongo CLI, you can access through command line:

mongo -u user -p password laradhoc

Otherwise, you can access through with your favourite tool, using this connection string:

mongodb://user:password@localhost/laradhoc

MailHog

To catch all outgoing emails via MailHog, configure your Laravel .env file with these parameters:

MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=
MAIL_PASSWORD=

MailHog web interface is available at

http://${APP_HOST}:${MAILHOG_PORT}

For example: http://laradhoc.test:8081

Contributing

Suggestions, reviews, bug reports are very welcome. We never stop learning :-)

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Thanks

Thanks to

for the inspiration

License

MIT

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