Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Laravel News:
Creating Multi-Stage Docker Builds for Laravel
Aug 17, 2018 @ 15:24:24

On the Laravel News site they've posted a tutorial showing you how to create multi-stage Docker builds for Laravel applications with a feature included in Docker 17.05.

Starting in Docker version 17.05 multi-stage builds are available to help you optimize Dockerfiles. Using multi-stage builds is a clean way to set up a Docker build pipeline that simplifies the requirements you need on your CI/build server to create a Docker image for your app.

If you’re not familiar with multi-stage builds, no worries! Let me summarize by saying that before multi-stage builds if you wanted to install composer dependencies and frontend dependencies during a docker build of your app, your Docker image would need to have the necessary dependencies such as Node.js installed and Composer PHP.

[...] By using multi-stage builds, you no longer need to install those dependencies or cram them all into your Dockerfile, thus bloating your final image size!

The tutorial then walks you through the multi-stage build approach using a new "demo" Laravel application as the base. In their example they show how to create the application, add it to a Git repository and set up the environment configurations. Next it includes the Dockerfiles required to create the different stages: installing Composer dependencies, installing Node dependencies and copying the application files and artifacts in to place.

tagged: tutorial laravel multistage docker build dependency

Link: https://laravel-news.com/multi-stage-docker-builds-for-laravel

Fortrabbit.com:
Multi Stage Deployment for Website Development
Oct 01, 2012 @ 17:11:35

On the Fortrabbit.com blog, there's a new post looking at a system for multi-stage deployment at a high level, applicable to most of the tools out there.

This article targets new developers and developers which never had the chance working with multi versioned websites before. If this fit’s you: Read it. Staging is a good tool in your belt you won’t regret to know. [...] You, your co-developers, authors and whatnot using [staging] to prepare and test stuff which is to be released into production. In short: you do not perform open-heart surgery by coding directly on the production website.

He talks about the "stages" part of the "multi-stage" structure, mentioning the separation of purpose they provide and an example of a three level configuration (dev, staging, production). An optional fourth level can be added as well for testing purposes. There are some downsides to this approach, though: data synchronization, code deployment delay and complexity. There's also a mention of gitflow and how it could help make this environment easier to set up for your applications.

tagged: multistage deployment development staging setup gitflow

Link:


Trending Topics: