- Copy Dockerfile and docker-compose.yaml to your project root directory.
- Confiure your .env file (HOST_PORT, UID, USER, DB_HOST)
- Configure service name in docker-compose.yaml as your wish
- tips (line 26 of docker-compose.yaml is should be matched with line 11 of .env DB_HOST)
docker-compose build (For the first time, building application stack)
docker-compose up -d
docker-compose down
If you have time, take a look at the scripts dir.
docker build --network host -t minlaxz/composer .
docker run --name dcomposer -v $(pwd):/var/www/html -it --network host minlaxz/composer
docker exec -it dcomposer bash -c "sudo -u $USER /bin/bash -c 'composer create-project --prefer-dist laravel/laravel appName'"