Eledock is a simple local development Docker stack optimized for Laravel and Symfony.
git clone https://github.com/adamluckdev/eledock.git
cd eledock
cp env-example .env
If you're using macOS, please update NON_ROOT_UID
and NON_ROOT_GID
values. To find out what is your local user uid and gid, run this command in your terminal.
id
cp services-example .services
Create new directory which will contain all your projects. Default directory path is ../www
relative to the eledock
directory.
This directory is mounted in containers:
- In PHP-FPM containers to
/var/www
- In Node.js container to
/home/node/www
To follow default settings execute these commands:
cd ..
mkdir www
Clone repository in projects directory according to APP_CODE_PATH_HOST env variable. Default directory path is ../www
relative to the eledock
directory.
cd ../www
git clone https://github.com/symfony/demo.git symfony-demo
Create new Nginx config from example in nginx/sites
.
cd nginx/sites
cp symfony.conf.example symfony-demo.conf
Update relevant directives such as:
server_name
root
- PHP version in
fastcgi_pass
access_log
anderror_log
file name
Finally, you must add new site domain to /etc/hosts
on your machine.
127.0.0.1 symfony-demo.localhost
If you add new site while the Eledock stack is running you must restart it with ./eledock restart
.
Each service defined in .services file will be started when you execute:
./eledock start
If you want to start additional services, just add them as additional arguments after start
./eledock start redis redis-webui
./eledock stop
./eledock restart
When entering PHP container you must specify the PHP version.
./eledock enter php 82
Node.js use FNM to manage multiple versions so there is only one container.
./eledock eneter nodejs
Node.js container is trying to invoke X11 server. To enable it on Linux run command suggested from this Github issue:
xhost +local:
MacOS users should follow guide from Cypress blog.