serversideup / docker-php

🐳 Production-ready Docker images for PHP. Optimized for Laravel, WordPress, and more!
https://serversideup.net/open-source/docker-php/
GNU General Public License v3.0
1.67k stars 109 forks source link

Added gosu to os dependencies #287

Closed sergiorodenas closed 4 months ago

sergiorodenas commented 6 months ago

Gosu is needed for doing later command: ["gosu", "www-data", "/usr/local/bin/php", "artisan", "horizon"] as the su version command: ["su", "www-data", "-c", "/usr/local/bin/php", "artisan", "horizon"] won't work due the www-data user having the login disabled internally.

AlejandroAkbal commented 6 months ago

Yeah, without this, using other user won't work, until it gets merged, this is a workaround:

Create a dockerfile with this

FROM serversideup/php:beta-${PHP_VERSION}-fpm-nginx

# TODO: Fix for gosu, remove when this is merged: https://github.com/serversideup/docker-php/pull/287
RUN docker-php-serversideup-dep-install-debian "gosu"

Compose:

    laravel-horizon:
        build:
          context: .
          dockerfile: Dockerfile
        command: ["gosu", "www-data", "/usr/local/bin/php", "artisan", "horizon"]
jaydrogers commented 5 months ago

Instead of the complexities with changing users, what do you think about this approach instead? https://github.com/serversideup/docker-php/issues/179#issuecomment-2052513529

AlejandroAkbal commented 4 months ago

This can now be closed