Sign inSign up

megabiz/php80-laravel

By megabiz

•Updated almost 4 years ago

Image
0

3.3K

megabiz/php80-laravel repository overview

⁠php80-laravel

⁠Usage:

This image has been prepared for laravel 8 projects that run on PHP 8.0 To use this image as your base image generate a file that has the name Dockerfile and put this piece of code on top of it.

FROM megabiz/php80-laravel:8.1.12

Then add your custom commands.

In its simplest form you can use this image just like this:

FROM megabiz/php80-laravel:8.1.12

COPY ./ /var/www

EXPOSE 8000

CMD ["sh", "-c", "php-fpm"]

⁠Extras:

If you want to add xdebug to your image add this code to your dockerfile.

RUN pecl install xdebug
RUN docker-php-ext-enable xdebug

If you want to run supervisor for your laravel worker you can put a supervisor conf file that has laravel-worker.conf name to your project as like this:

[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/artisan queue:work --sleep=3 --tries=3
autostart=true
autorestart=true
user=root
numprocs=1
redirect_stderr=true
stdout_logfile=/var/www/storage/logs/supervisor-panel-worker.log

Finally, your Dockerfile should be like to run with supervisord:

FROM megabiz/php80-laravel:8.1.12

COPY ./laravel-worker.conf /etc/supervisor/conf.d/
COPY ./ /var/www

EXPOSE 8000

CMD ["sh", "-c", "/usr/bin/supervisord -c /etc/supervisor/supervisord.conf && php-fpm"]

Tag summary

Content type

Image

Digest

sha256:4644c77e9…

Size

235.6 MB

Last updated

almost 4 years ago

docker pull megabiz/php80-laravel:8.1.12