Cybrarist / Discount-Bandit

Track products pricing across multi ecommerce stores such as amazon,ebay,walmart, target and many more.
https://discount-bandit.cybrarist.com
GNU General Public License v3.0
257 stars 10 forks source link

Docker container fails to start ("failed to open stream" for autoload.php) #27

Open rmelotte opened 9 hours ago

rmelotte commented 9 hours ago

After a fresh clone of the repository, checking out the the v3.2 branch and running docker-compose up, the docker container fails to start.

In the logs, the following warning is repeated:

discount-bandit-discount-bandit-1  | 2024-11-14T09:08:16.943448076Z Warning: require(/app/vendor/autoload.php): Failed to open stream: No such file or directory in /app/artisan on line 9
discount-bandit-discount-bandit-1  | 2024-11-14T09:08:16.943463651Z 
discount-bandit-discount-bandit-1  | 2024-11-14T09:08:16.943476572Z Fatal error: Uncaught Error: Failed opening required '/app/vendor/autoload.php' (include_path='.:/usr/local/lib/php') in /app/artisan:9
discount-bandit-discount-bandit-1  | 2024-11-14T09:08:16.943489562Z Stack trace:
discount-bandit-discount-bandit-1  | 2024-11-14T09:08:16.943501925Z #0 {main}
discount-bandit-discount-bandit-1  | 2024-11-14T09:08:16.943513868Z   thrown in /app/artisan on line 9

Furthermore, composer, which is mentioned in the README as a dependency, doesn't seem to be installed in the docker container (or it's not in the PATH?).

Am I missing something?

rmelotte commented 9 hours ago

Furthermore, after manually installing composer in the running container using the instructions from its website and running composer install, the following error message appears:

root@8201863994e8:/app# composer install 
Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - chrome-php/wrench is locked to version v1.6.0 and an update of this package was not requested.
    - chrome-php/wrench v1.6.0 requires ext-sockets * -> it is missing from your system. Install or enable PHP's sockets extension.
  Problem 2
    - chrome-php/chrome is locked to version v1.11.0 and an update of this package was not requested.
    - chrome-php/chrome v1.11.0 requires chrome-php/wrench ^1.6 -> satisfiable by chrome-php/wrench[v1.6.0].
    - chrome-php/wrench v1.6.0 requires ext-sockets * -> it is missing from your system. Install or enable PHP's sockets extension.

To enable extensions, verify that they are enabled in your .ini files:
    - /usr/local/etc/php/conf.d/docker-php-ext-bcmath.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-bz2.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-calendar.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-intl.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-opcache.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-pcntl.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-pdo_mysql.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-sodium.ini
    - /usr/local/etc/php/conf.d/docker-php-ext-zip.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-sockets` to temporarily ignore these required extensions.

In this case I guess the following is missing somewhere? :

docker-php-ext-install sockets
Cybrarist commented 1 hour ago

if i understood correctly, you cloned the github repo and then ran docker-compose command, right ?

in this case, you need to check your system to make sure it meets the composer packages requirements, as it's not an issue with docker neither the software.

what i would recommend, since docker compose will check your system's requirements to install composer packages, and since you already have docker install, it would be easier to change from to just run docker compose on the docker image instead of building the context.

Edit: i have retested the docker images uploaded to docker hub and they seem fine. can you share the exact steps that you have taken to install code on your device please.