Skip to content

Issue running docker in production mode #1137

@raserma

Description

@raserma

Hi,
We got Userfrosting running on our systems and I'd like to migrate it to Docker.
So I am trying to deploy Userfrosting in docker using the UF_MODE=production. However, after the installation, the frontend application fails with:

Something's not right here.

Please fix the following errors, then reload..
Incorrect permissions for file or directory.

/app/app/sprinkles is writeable, but it should not be writeable. Please modify the OS user or group permissions so that user www-data does not have write permissions for this directory.
Incorrect permissions for file or directory.

/app/app/vendor is writeable, but it should not be writeable. Please modify the OS user or group permissions so that user www-data does not have write permissions for this directory.

I have tried to give those folders read-only permissions, but then the frontend fails with the following:

Warning: require_once(/app/app/vendor/autoload.php): failed to open stream: Operation not permitted in /app/public/index.php on line 17

Fatal error: require_once(): Failed opening required '/app/public/../app/vendor/autoload.php' (include_path='.:/usr/local/lib/php') in /app/public/index.php on line 17

Am I supposed to run production mode with Docker?

If I switch back to development mode before making those folder read-only, and restart the container, the portal loads successfully and I am able to login. However, with development mode enabled, the app container doesn't log anything from php-fpm service, which is not ideal.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions