Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions about Usage #3

Open
benyanke opened this issue May 6, 2018 · 2 comments
Open

Questions about Usage #3

benyanke opened this issue May 6, 2018 · 2 comments

Comments

@benyanke
Copy link

benyanke commented May 6, 2018

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
Copy link
Author

benyanke commented May 6, 2018

Additionally, how do you handle permissions?

@vcarreira
Copy link
Owner

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:

  • source dc-aliases to read the aliases
  • dc-up to bring the containers up
  • run a shell on the nginx container to issue artisan commands
  • dc-down to bring the containers down when I no longer need them or to free some resources before switching to another project

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants