Skip to content

Latest commit

 

History

History
98 lines (80 loc) · 3.5 KB

File metadata and controls

98 lines (80 loc) · 3.5 KB

Laravel Alpine

Laravel PHP Framework running on alpine base Docker Image with or without Nginx 🐳

GitHub Workflow Status (with event) LICENSE Stars Count Forks Count Watchers Count Issues Count Pull Request Count Follow

SIZE

Pull it from Github Registry

To pull the docker image:

docker pull ghcr.io/dnj/laravel-alpine:8.1-mysql-nginx

Usage

To run from current dir

docker run -v $(pwd):/var/www -p 80:80 ghcr.io/dnj/laravel-alpine:8.1-mysql-nginx "composer install --prefer-dist"

What's Included

Other Details

  • Alpine base image

PHP Extension

  • opcache
  • mysqli or pgsql
  • pdo
  • pdo_mysql or pdo_pgsql
  • sockets
  • json
  • intl
  • gd
  • xml
  • zip
  • bz2
  • pcntl
  • bcmath
  • inotify
  • redis
  • memcached
  • soap
  • ssh2

Adding other PHP Extension

You can add additional PHP Extensions by running docker-ext-install command. Don't forget to install necessary dependencies for required extension.

FROM ghcr.io/dnj/laravel-alpine:8.1-mysql-nginx
RUN docker-php-ext-install xdebug

Adding CRON

FROM ghcr.io/dnj/laravel-alpine:8.1-mysql-nginx
echo '* * * * * /usr/local/bin/php /var/www/artisan schedule:run' >> /etc/crontab 

Adding custom Supervisor config

You can add your own Supervisor config inside /etc/supervisor.d/ for Laravel Queue or Laravel Horizon. File extension needs to be *.ini. By default this image added php-fpm and crond process in supervisor.

E.g: For Laravel Horizon make file horizon.ini

[program:horizon]
process_name=%(program_name)s
command=php /home/forge/app.com/artisan horizon
autostart=true
autorestart=true
user=forge
redirect_stderr=true
stdout_logfile=/home/forge/app.com/horizon.log

On your Docker image

FROM ghcr.io/dnj/laravel-alpine:8.1-mysql-nginx
ADD horizon.ini /etc/supervisor.d/

For more details on config http://supervisord.org/configuration.html

Bug Reporting

If you find any bugs, please report it by submitting an issue on our issue page with a detailed explanation. Giving some screenshots would also be very helpful.

Feature Request

You can also submit a feature request on our issue page or discussions and we will try to implement it as soon as possible.