Class "Facade\Ignition\IgnitionServiceProvider" not found when running php artisan in docker container

2.2k Views Asked by At

Been trying to solve this problem for the last few days to no avail. Basically have been trying to dockerize my application for deployment, but whenever I go inside the container and try to run "php artisan", I get the following error:

In Application.php line 745:
                                                             
  Class "Facade\Ignition\IgnitionServiceProvider" not found  

The only way the error gets fixed is when I run composer install --ignore-platform-reqs, but not sure I should be doing this manually every time I'm in docker, when the command is in the Dockerfile itself. I was told it might be a composer/php discrepancy issue, but really lost here. I've tried composer dump-autload, update, moving facade/ignition outside of "require-dev" in composer.json file.. with nothing working. Any help would be appreciated! Below is my Dockerfile, please let me know if any more information is needed as this is my first time posting here.

Dockerfile:

ARG PHP_EXTENSIONS="apcu bcmath pdo_mysql redis imagick gd"
FROM thecodingmachine/php:8.1-v4-fpm as php_base

ENV TEMPLATE_PHP_INI=production
#copy our laravel application to html
COPY --chown=docker:docker . /var/www/html

RUN composer install --quiet --no-dev --dev --no-scripts --no-interaction --no-progress --prefer-dist --optimize-autoloader --ignore-platform-reqs
FROM node:14 as node_dependencies

WORKDIR /var/www/html
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=false
#bring in the laravel application from the php_base to our node js container
COPY --from=php_base /var/www/html /var/www/html

RUN npm set progress=false && \
    npm config set depth 0 && \
    npm install && \
    npm run prod && \
    rm -rf node_modules

FROM php_base
#bring the finished build back into the php container
COPY --from=node_dependencies --chown=docker:docker /var/www/html /var/www/html
1

There are 1 best solutions below

0
janki singh On

You can use the following command to update all project dependencies:

composer update

or

composer u

(This is what worked out for me)