DEV Community

loading...

Discussion on: docker-compose up your entire Laravel + Apache + MySQL development environment.

Collapse
veevidify profile image
V Author • Edited

Hi,
The setup I had on the repo use volume mount for the source, so that any changes, including composer install (vendor folder) persist on the host, for ease of development.

If you simply want a running app with vendor packages inside the container, you need to add composer.json into the container during build stage. Refer to this part of the article:

...you'll need to add the source files into the container pre-build...

COPY . /var/www/html
RUN cd /var/www/html && composer install && php artisan key:generate

Note that by doing this, your host pc won't have the vendor packages persisted.