Complete the code to specify the base image for a Laravel Docker container.
FROM [1]The base image php:8.1-fpm is commonly used for Laravel applications to run PHP with FastCGI Process Manager.
Complete the Dockerfile command to copy the Laravel application files into the container.
COPY [1] /var/www/htmlsrc/ or app/ folder which misses other important files.public/ folder which is incomplete.The COPY . /var/www/html command copies all files from the current directory (where the Dockerfile is) into the container's web root.
Fix the error in the Dockerfile command to install Laravel dependencies using Composer.
RUN composer [1] --no-dev --optimize-autoloadercomposer update which updates packages instead of installing locked versions.composer require which adds new packages.dump-autoload which only regenerates autoload files.The correct command is composer install to install dependencies listed in composer.json.
Fill both blanks to expose the correct port and set the working directory in the Dockerfile.
EXPOSE [1] WORKDIR [2]
/app which is not where files are copied.Laravel's built-in server commonly uses port 8000, and the working directory should be the web root /var/www/html.
Fill all three blanks to define a Docker Compose service for Laravel with build context, ports, and volumes.
services:
app:
build: [1]
ports:
- "[2]:8000"
volumes:
- [3]:/var/www/htmlThe build context is the current directory ., port 8000 is mapped, and the current directory is mounted as a volume to sync files.