Series Part II — Optimizing My Alpine Docker Image for Use With Drupal 8.x and PHP 7.3

Docker Image Structure

#1 php7-fpm.core:alpine-3.11 -> Minimal PHP image
|
|- #2 php7-cli.core:alpine-3.11 -> CLI PHP image, adds Composer
|
| - #3 php7-cli.drush9:alpine-3.11 -> Adds Drush 9

Building Composer and Drush

php7-cli.core:alpine-3.11.Dockerfile Docker Image #2 → CLI PHP image, adds Composer
php7-cli.drush9:alpine-3.11.Dockerfile: Docker Image #3 -> Adds Drush
docker-compose -f ./build/nginx/docker-compose.yml build \
&& docker-compose -f ./build/mariadb-alpine/docker-compose.yml build \
&& docker-compose -f ./build/php-fpm/docker-compose.yml build \
&& docker-compose -f ./build/php-cli/docker-compose.yml build
Composer: You Must Install Additional Pylons
Composer and Drush images built

Installing Drupal using Composer

docker-compose: sudo make me a drush sandwhich https://xkcd.com/149/
Ready to install Drupal using Drush …
composer create-project drupal/recommended-project my_site_name_dir --no-interaction
composer create-project drupal/recommended-project localenv-2020 --no-interaction

The Result:

The Real Test — Running the Drupal Installation Wizard, Using My Alpine Docker Image

3bd1402354e7# rm -rf localenv/app
3bd1402354e7# mv localenv-2020 localenv/app
3bd1402354e7# ln -s web docroot
3bd1402354e7# ls -lad docroot web
lrwxrwxrwx 1 root root 3 Jan 2 00:34 docroot -> web
drwxrwxrwx 2 root root 4096 Jan 2 00:34 web
SUCCESS: Behold The Drupal Installation Page !
Unami? Sounds fancy delicious !
Some things to address later …
Drupal telling us our Docker container’s specs. Everything checks out out-of-the-box.
Ahh … I need a database!
mysql -u root --host=127.0.0.1
My new Drupal database name is happy2k20 :)
Downloading translations took a minute, I’d be nice to skip it.
docker-compose top
I hope Medina Station gets the Memo Klaes Ashford sent them
Final Step ?
The styles seem a bit off for a fancy demo … but OK, I’ll take an order of that Quiche.
Failed to create style directory

Organic, fair-sourced DevOps and Full-Stack things. This is a BYOB Establishment — Bring Your Own hipster Beard.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store