Tutorial to build a PHP web development environment with Docker Compose, PHP 7.2, Composer, Apache web server, MySQL database, and install Zend Expressive for a PHP project. (see shortcuts below to key points) Adam Culp of Beachcasts php videos walks through creating a PHP development environment with Docker containers using a leading php framework.
For a video using Windows WSL 2, see https://youtu.be/_H1iKXksjF0
Later we will be introducing Zend Framework (Laminas Project) components, as well as components from other projects.
Next video in the series: https://youtu.be/FQWL-JTZvf4
It is part of the playlist: https://www.youtube.com/playlist?list=PL6_nF0awZMoMol4RPLf99WIZuoJ3l87oG
Please * LIKE, COMMENT, AND SUBSCRIBE * – and share with others!
Key Topics:
– How to use Composer
– How to install Zend Expressive Skeleton Application
– How to use Docker-Compose to create a Docker container
– How to create a Dockerfile
– How to create a docker-compose.yml file
For a nice list of equipment I use in my studio, and to support the channel if you make any purchases (doesn’t cost you a thing), visit my kit at kit.co: https://kit.co/beachcasts/beachcasts-studio
Code used in this, and in future videos of this series is located at: https://github.com/Beachcasts/doctrine-expressive-example but please see errata about some data changes at this stage.
Associated Links:
https://www.docker.com/ – Home of Docker Containers
https://docs.docker.com/compose/ – Documentation showing how to use Docker Compose
http://php.net/ – Home of the PHP programming language
https://getcomposer.org/ – Site for installing and using Composer with PHP
https://www.mysql.com/ – Main site for the MySQL database
https://getexpressive.org/ – Main site for Zend Expressive
Errata:
At 5:41 – Should have said 12.2 Billion, not Trillion
At 13:50 – Composer does not create the composer.json, that is part of the origin package
At 16:08 – Serve command is defined in composer.json, not a feature of Composer
At 17:02 – Composer is installed to /usr/local/bin
At 22:35 – The schema.sql shows an is_admin field in the announcements table. This should be removed. Also, the id column in the announcements table should be int(11) and auto increment instead of char(36)
At 31:04 The referenced image does not use Ubuntu, it is Debian
At 31:27 Due to recent versions of Debian removing mysql-client, use mariadb-client instead for this example.
Keypoints:
00:00 Video Intro
01:20 – Introduction to Composer (the PHP dependency manager) from https://getcomposer.org
02:35 – How to get the current PHP version via CLI
04:24 – Introduction to Packagist from https://packagist.org
07:26 – Introduction to Zend Expressive at https://docs.zendframework.com/zend-expressive/
08:17 – Using the command line (CLI) to install zend-expressive-skeleton with Composer. Followed by the installation wizard steps.
13:55 – Brief description of composer.json contents
16:30 – Using the new PHP internal web server via Composer.
21:53 – Adding a SQL schema file for import to MySQL database.
23:45 – Create a docker-compose.yml file, and explain parts.
28:20 – Create the Dockerfile file for the web server creation from an image on Docker Hub, and explain the contents.
35:35 – Launch Docker using docker-compose command.
37:20 – Show how to view current Docker containers using ‘docker ps’.
38:28 – Edit the composer.json to alter package version dependency, for when a different version is desired. Then run ‘composer update’ to update the packages.
Other Beachcasts PHP tech videos you might find interesting:
Developing on Windows WSL 2 https://youtu.be/_H1iKXksjF0
Make your local DEV environment available on the internet https://youtu.be/xs2o7B_Ex9E
AWS Elastic Load Balancer (ELB) Tutorial How-To https://youtu.be/Sr2Mq9Gegew
Behat for beginners functional REST API testing tutorial https://youtu.be/nFNGDhyFrm4
Doctrine ORM one-to-many bi-directional association https://youtu.be/4nEdBDxBc1w
Doctrine ORM one-to-many self-referencing association https://youtu.be/4dHZ6cZooOk
Use UUID with Doctrine ORM for DB keys https://youtu.be/SYuLwMwSIpg
Automate Hypermedia creation for PHP REST API https://youtu.be/dX6S-pJVUXI
Learn about Hypermedia and how to create it https://youtu.be/aV6ro_JXL_A
Doctrine ORM Paginator for PHP REST API https://youtu.be/UpqOew4sNT0
Doctrine ORM Entity how to https://youtu.be/NnK9Geg1h_E
Configure Doctrine ORM https://youtu.be/pFvh5ZNhdOQ
Create PHP middlware with Zend Expressive https://youtu.be/26440j7D0BE
Help through referrals:
Thinking of buying a Tesla electric vehicle? Use this referral link to also get six months of free Supercharging for both of us. Thank you. https://www.tesla.com/referral/tanya21367
I use TubeBuddy to help me manage my YouTube channel. If you’re interested, click the following link to check it out. https://www.tubebuddy.com/beachcasts
#Docker #ZendExpressive #Beachcasts


Comments