I am trying to run a laraver project in a docker container.
My dockerfile:
FROM php:8.0.12-cli
...
# Install composer.
ENV COMPOSER_ALLOW_SUPERUSER 1
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/bin --filename=composer --quiet \
&& rm -rf /root/.composer/cache
# Install git.
RUN apt-get update && apt-get install -y git
# Clone laravel project from repo.
RUN git clone https://${USERNAME}:${TOKEN}@github.com/${USERNAME}/api.myproject.com.git
# Copy laravel project to app folder.
RUN cp -r /api.myproject.com/. /app
WORKDIR /app
RUN composer install
Everything seems to be fine, but when I opened the application, I saw an error:
Warning: require(vendor/autoload.php): failed to open stream: No such file or directory
I went into the container and found that the vendor folder was missing, although there were no errors when executing the composer install command and at the end I received a notification that all dependencies were successfully installed.
I don't understand how to fix this, my only guess is that the composer may not have enough permissions to create the vendor directory.