A single container with fpm & nginx with Laravel dependencies
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.travis.yml
Dockerfile
README.md
default.conf

README.md

FPM/Nginx for Laravel

Build Status

This container is intended to run Laravel applications and build front-end dependencies. Check out https://hub.docker.com/r/bkuhl/laravel-fpm-nginx for a full list of tags. It includes:

  • PHP-FPM
  • Yarn (uses nodejs/npm)

For non-Laravel applications, see bkuhl/fpm-nginx.

For a container to run cron and other CLI tasks, check out bkuhl/php.

Example Dockerfile

FROM bkuhl/laravel-fpm-nginx:latest

WORKDIR /var/www/html

# Copy the application files to the container
ADD --chown=www-data:www-data  . /var/www/html

USER www-data

    # production-ready dependencies
RUN composer install  --no-interaction --optimize-autoloader --no-dev --prefer-dist \

    # keep the container light weight
    && rm -rf /home/www-data/.composer/cache \
    
    # compile front-end assets
    && yarn install \
    && yarn run production \
    && yarn cache clean

USER root