Laravel PHP framework running on PHP-FPM with alpine base Docker Image 🐳
To pull the docker image:
docker pull kamerk22/laravel-alpine:latest
To run from current dir
docker run -v $(pwd):/var/www kamerk22/laravel-alpine:latest "composer install --prefer-dist"
- Composer ( with non Root user )
- CRON ( pre-installed and configured to work with Laravel Scheduler )
- Supervisor
- Alpine - 3.8
- opcache
- mysqli
- pgsql
- pdo
- pdo_mysql
- pdo_pgsql
- sockets
- json
- intl
- gd
- xml
- zip
- bz2
- pcntl
- bcmath
You can add additional PHP Extensions by running docker-ext-install
command. Don't forget to install necessary dependencies for required extension.
FROM kamerk22/laravel-alpine:latest
RUN docker-php-ext-install memcached
FROM kamerk22/laravel-alpine:latest
echo '0 * * ? * * /usr/local/bin/php /var/www/artisan schedule:run >> /dev/null 2>&1' > /etc/crontabs/root
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 kamerk22/laravel-alpine:latest
ADD horizon.ini /etc/supervisor.d/
For more details on config http://supervisord.org/configuration.html
Feel free to open an issue in this repository or contact me on Twitter.