serversideup / docker-php

🐳 Production-ready Docker images for PHP. Optimized for Laravel, WordPress, and more!
https://serversideup.net/open-source/docker-php/
GNU General Public License v3.0
1.74k stars 119 forks source link

cannot run composer install in Dockerfile #310

Closed burasuk closed 6 months ago

burasuk commented 6 months ago

Affected Docker Images

serversideup/php:8.2-fpm-nginx

Docker Labels of the affected images

No response

Current Behavior

When i run docker compose up i have error:

PHP Fatal error: Uncaught Error: Failed opening required '/var/www/html/vendor/autoload.php' (include_path='.:/usr/share/php') in /var/www/html/artisan:18 which suggest that composer install don't run. Vendor folder not axists.

Expected Behavior

docker compose up should run container properly and the application should be available

Steps To Reproduce

docker compose file (simplify):

services:

  php:
    build:
      context: .
      dockerfile: Dockerfile
    volumes:
      - .:/var/www/html/

Dockerfile

FROM serversideup/php:8.2-fpm-nginx

COPY --chown=www-data:www-data . /var/www/html

RUN composer install --no-dev --ignore-platform-reqs --optimize-autoloader --prefer-dist --no-ansi --no-interaction --no-progress --no-scripts

Host Operating System

WSL

Docker Version

20.10.14

Anything else?

No response

jaydrogers commented 6 months ago

Use the beta images. Sorry for the confusion!