simple docker-compose templates for Laravel, Node.js frontend(example Vue.js) and Swagger.
this use prefer officeal last images.
Linux, OSX amd Windows firiendly.
- Docker
-
Build Docker container
git clone [email protected]:m2wasabi/docker-compose-templates.git
if you use different config (minimal usage) try another branches.
-
Clone youe project
git clone [email protected]:<your account>/<your Laravel project>.git app
and Additional side project (if needed)
git clone [email protected]:<your account>/<your Vue.js project>.git node git clone [email protected]:<your account>/<your Swagger project>.git swagger
or new blank project
mkdir -p app/public
-
Configure containers
.docker/localdev/nginx/conf.d/vhosts-main.conf
- Comment or uncomment settings
.docker/localdev/php-fpm/Dockerfile
- Configure php packages
.docker/localdev/node/scripts/bootstrap.sh
- Configure entrypoint
docker-compose.yml
- Comment or uncomment settings
-
Build Docker container
docker-compose build
-
Start containers
docker-compose up
-
Join console to Setup
Linux/OSX
./php.sh ./mysql.sh
Windows
.\php.bat .\mysql.bat
then, enter php-fpm container
/scripts/setup.sh
docker-compose up
docker-compose down
ContainerDelete command does NOT delete data and contents.
PHP server
./php.sh
or
php.bat
composer global require laravel/installer
PATH=$PATH:$HOME/.composer/vendor/bin/
export PATH
laravel new
If you use redis install predis
composer require predis/predis
Edit .env
file
DB_HOST=mysql
REDIS_HOST=redis
CACHE_DRIVER=redis
SESSION_DRIVER=redis
QUEUE_DRIVER=redis
-
Setup New Appplication
/scripts/setup.sh
-
Update Application (migrate)
/scripts/update.sh
-
Database clean and rebuild
/scripts/db_reset.sh
MySQL Server
./mysql.sh
or
mysql.bat
-
.mysql_data/
MySQL database storage
If destroy this content, Docker re-create new database. -
app/public
Web publish files -
node/server.js (Default Disabled)
Node.js execute file as a web server -
swagger (Default Disabled)
Web publish files on http://localhost:8080/swagger/