wodby / docker4php

Docker-based PHP stack
https://wodby.com/docker4php
MIT License
277 stars 44 forks source link

Some problems upon working with Laravel #3

Closed roman-yakimkin closed 5 years ago

roman-yakimkin commented 5 years ago

Hello. I'm a novice in docker. I need to work with Laravel using docker-compose and I decided to use this solution. I managed to set up containers and install Laravel. But I encountered some problems.

  1. An error. "The stream or file "laravel.log" could not be opened: failed to open stream: Permission denied". I don't know how to solve it correctly without forcibly setting rights as 777.
  2. Could you clarify me, how can I get into the running container via my terminal? I mean I need to type "php -v" or "php artisan" in my terminal and it should work correctly. How can I do it?
csandanov commented 5 years ago

Hi,

  1. what's the location of laravel.log, is it created by Laravel?
  2. run make shell if you have Makefile or docker exec -ti [PHP CONTAINER ID] sh
alsar commented 5 years ago

@roman-yakimkin you should set the PHP_FPM_USER and PHP_FPM_GROUPenvironment variables for the php container to wodby so that FPM has write access.

csandanov commented 5 years ago

yes, that's one of the options, less secure but totally fine for the local development

alsar commented 5 years ago

What do you propose for the production environment?

csandanov commented 5 years ago

Have this file owned by www-data so FPM could write to it or owned by wodby and have www-data group with group writing permissions.