June 12, 2018

Connecting Containers

^ Ad space to help offset hosting costs :D

We run a Laravel application!

docker run --it --rm -v $(pwd):/var/www/html \
    -w /var/www/html \
    shippingdocker/app:latest \
    composer create-project laravel/laravel application

This shares our current direwctory into the /var/www/html directory in the container, and then runs composer create project... to get Composer to add a Laravel project into a new directory named application.

We then update the application .env file to point MySQL to hostname mysql and run some migrations. It works!

The containers are both running within the same Docker network as described in the last video, and as described further in this video.

Looking for a deeper dive into Docker?

Sign up here to get a preview of the Shipping Docker course! Learn how to integrate Docker into your applications and develop a workflow to make using Docker a breeze!

All Topics