brefphp / bref

Serverless PHP on AWS Lambda
https://bref.sh
MIT License
3.1k stars 367 forks source link

Laravel does not work when creating a local development environment with docker-compose #1644

Closed Syzgyn closed 1 year ago

Syzgyn commented 1 year ago

Description: When following the directions on the bref wiki on local development in docker, I get the following error: Unable to create lockable file: /tmp/storage/framework/cache/15/ed/15ed45fc33a4af8dc4baab88de709b23759e5b28. Please ensure you have permission to create files in this location.

Full Stacktrace available here

This is happening in the php-81, 82, and 83 fpm-dev docker images.

Also found someone with the same issue here: https://github.com/brefphp/bref/issues/470#issuecomment-1513221424

How to reproduce:

  1. Create a new laravel project with composer create-project laravel/laravel test-project
  2. Follow the setup instructions here
  3. Create the docker-compose.yml file from here
sunaoka commented 1 year ago

Try specifying nobody as user.

services:
    app:
        image: bref/php-81-fpm-dev:2
        ports: [ '8000:8000' ]
        volumes:
            - .:/var/task
        environment:
            HANDLER: public/index.php
        user: nobody  # <-----
Syzgyn commented 1 year ago

That did it, thank you!