vcarreira / docker-laravel

A docker Compose file for Laravel development
36 stars 12 forks source link

Questions about Usage #3

Open benyanke opened 6 years ago

benyanke commented 6 years ago

This is an excellent framework - I've adapted it slightly for my own use!

My main question: how do you go about provisioning on startup? Do you assume the user is going to run composer install, npm install, artisan migrate, and the other commands required for bringing up a full laravel environment from a repository (which would typically have the composer and npm packages gitignored), or is there a facility available using your framework to run those commands when the image comes up?

If you don't have one, would you be open to a PR which creates one?

benyanke commented 6 years ago

Additionally, how do you handle permissions?

vcarreira commented 6 years ago

Hi Ben, I'm no longer using this directly. I have a yo generator to create a more detailed docker-compose.yml file from an empty or existing laravel project. You can find more info here: https://github.com/vcarreira/generator-docker-laravel.

Because I'm using this as a developer I didn't follow a pure container approach. I have composer, node + npm + yarn installed on my host OS to quickly add packages or compile front-end stuff. For the artisan stuff I prefer to run a shell on the nginx container: docker exec -it <nginx_httpd_container> /bin/bash

I mainly use this to isolate Laravel projects I'm working on. My usually workflow for new Laravel projects is: 1) Create a new laravel project 2) Use the yo-generator to create a docker-compose file with the intended services

Day to day workflow:

However if you want to follow a pure container approach you can use the dc-npm, dc-composer and dc-art aliases.

I'm opened to PR but check first the https://github.com/vcarreira/generator-docker-laravel repo to better understand why I've moved from this kind of manual setup to a more automated one.