Simple PHP local development environment for unix/linux based OS.
- App container : an alpine based web app container with php7, mysql, pgsql, mongodb, sqlite, pdo, etc php drivers served through php-fpm.
- Server container : an alpine based nginx server with dynamic server name routing.
- named project url with .box and .lara (for laravel apps)
- dns routing through host dnsmasq and .box/.lara resolvers
- Gearman container : for background job processing
- RDBMS : alpine based mariadb sql database
- Nosql : bionic based mongodb container
- PgSql : alpine based PostreSql container
- Install docker
- Install docker-compose
- Install dnsmasq. A lightweight DNS, DHCP manager.
- Install git
-
Configure dnsmasq to resolve
.boxand.lara(for laravel apps) tolocalhost/127.0.0.1- Add these lines in your
dnsmasq.conffile (general location /etc/dnsmasq.conf)
address=/.box/127.0.0.1 address=/.lara/127.0.0.1- Create two files box and lara in /etc/resolver (create resolver dir if not exist) with content
nameserver 127.0.0.1 - start and enable dnsmasq service to start on system start
sudo systemctl enable dnsmasq.service sudo systemctl start dnsmasq.service - Add these lines in your
-
Clone repo
git clone repo folder cd folder -
Run
docker-compose upto start local php dev env -
Type
test.boxin your fav browser to verify the setup