Skip to content

Improve the PLA container experience #442

@mlavi

Description

@mlavi

As a new adopter of PLA container, I wanted to offer feedback on a few bumps I've encountered and missed expectations versus most other container operations. After any discussion, I'm happy to break these apart into separate issues if that is best. I am not new to PHP, PLA 1.x, or maintaining containers, but I am new to the PLA 2.x container, Composer, Laravel, Caddy, and FrankenPHP, so I may have missed documentation or configuration. I expect most of these to augment environment configuration variables.

  1. By default, there are no PLA container logs displayed by container management facilities.

Problem: after the container is healthy, no additional logs appear, even when APP_DEBUG=true. Workaround: enter container and view /app/storage/logs/laravel-YYYY-MM-DD.log or provide a volume to this directory and view from the host. Alternatives: would it be possible to enable environment variable to configure Laravel logs (of different categories? e.g.: stacktrace, ALERT, etc.) to go to STDOUT and appear in Docker/Podman/etc. logs?

  1. PLA container Linux USER and GROUP are both www-data = 82.

Problem: container host volume directory permission problems when host user+group != 82, which is typical.
Solution: workaround is to make persistent volume permissions on the host set to other:rwx. Alternatives: I've seen most places elsewhere is to allow running the container as an arbitrary USER and GROUP set by environment variables and by default build and run the container with USER and GROUP = 1000, which is the default first Linux user on new installs.

  1. The container takes a notable amount of time (10+ seconds IIRC) to start or restart and become healthy to serve the web.

Problem: minor, but it is notably slower than most containerized web applications (I deploy on a Raspberry Pi). Solution: become healthy in under 3 seconds. Alternatives: I'll take a look at the Dockerfile, but I heard mention of an opcode cache. Would it be possible to warm a pre-cache into the Docker container layer or serve without cache?

  1. Container documentation needs improvement to address the above problems and some configuration examples, including reverse proxy!

Solution: I'll contribute to the wiki after these discussions.

  1. Container restarts do not always preserve environment variables.

Problem: I iterate on the environment file configurations, but lose environment variables on container restart and see the environment revert to only the defaults. Workaround: stop and delete the container with associated volumes, then re-instantiate the configuration with an external environment file. I'll add detail when I can reproduce consistently.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions