Skip to content

rainercedric23/docker-lemp-stack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Lemp Stack

Is Windows slowing you down ? Well this Docker stack won't.

Features

  • Nginx with exposed awesome vhost support
  • MariaDB with data mounted on the folder (say goodbye to missing DBs)
  • Need to destroy your Docker stack, you keep all data, even your Databases
  • Redis with data mounted on the folder
  • PHP 7 with FPM
  • Create instance from scratch for about 10 - 15 mins
  • Up or halt the instance almost instantly (well 5 secs to be exact)

This stack was based from the Laradock project.

Getting Started

Pretty straightforward

  • Clone this repository
  • Copy .env.example to just .env
  • See usage notes for command list

Usage

This Docker stack includes easy commands, so you do not need to remember the commands to run or reload things.

If you edit vhosts, for example, you need to reload nginx. If you edit mariadb settings, then you need to reload it.

  • ./bin/start Starts the stack
  • ./bin/stop Stops the stack
  • ./bin/reload Reloads everything, but does not recreate it
  • ./bin/reload nginx Recreates nginx instance
  • ./bin/reload <service_name> Recreates any service instance

Notes for stack websites

Please check docker-compose.yml on the php-fpm extra host section. You might need to adjust your extra hosts to match your custom host file for Drupal, API layer and other sites that connect internally.

FAQ

How does Docker mounting work ?

On the .env file there is a APPLICATION variable which you can set manualy to any folder (although I recommend just to leave) it as it is. This gets mounted to the Docker workspace to the folder /var/www

How to add new Nginx vhost ?

Simply go to ./services/nginx/sites as this folder gets mounted on the conf.d of nginx directly. After adding new sites, simply run ./bin/reload

What folder path should I put on the vhost ?

Suppose your project resides in ~/Projects/CMS/my-site then your vhost entry should be /var/www/CMS/my-site

Configured vhost already but still the site cannot be reached ?

Make sure to add your server name(s) on etc/hosts file (may require sudo privilege)

How to access DBs on my Drupal (or any PHP application)

On your config, you can simply put mariadb as the hostname of your Database. Default username is root and password is secret

How to access DB using Workbench or SQLyog

If you are on Windows, use the static IP and use port 3306. If within the VM, use the static IP defined on the docker-compose file

Troubleshooting

  • Destroy then initialize the machine
  • If it does not solve your problem, Restart your PC 3 times
  • If problems persist, fix it, or raise an issue on git

About

Docker created for Linux, Nginx, MySQL and PHP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published