Our great sponsors
-
SurveyJS
Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App. With SurveyJS form UI libraries, you can build and style forms in a fully-integrated drag & drop form builder, render them in your JS app, and store form submission data in any backend, inc. PHP, ASP.NET Core, and Node.js.
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
For this blog post, we will containerize the sample Laravel task-list application provided on GitHub. This project was written against a reasonably old version of Laravel and has since been archived. However, working with this codebase requires that we address a number of requirements commonly found in production and legacy code bases, such as using specific versions of PHP, database migrations, port mappings, and running integration tests.
We then use the docker/setup-buildx-action action to initialize an environment to build Docker images:
Finally, we use the docker/build-push-action action to build the Docker image. By setting the with.push property to true, the resulting image will be pushed to DockerHub.
You can find a fork of the sample application repository that contains the GitHub Actions workflow above here.
The run argument instructs Docker to run the Docker image passed as the final argument, which is mysql. As we noted in the introduction, every major tool provides a supported Docker image, and MySQL is no exception. The MySQL image has been sourced from the default Docker registry called DockerHub, which provides the repository mysql.
There are any number of CI platforms that can be used to build Docker images. For this post, we'll make use of GitHub Actions.
In addition to the major cloud providers, you can deploy containers to Heroku, Dokku, Netlify, and many more.
If there is one benefit to containerizing your applications, it is the incredible range of platforms that they can be deployed to. You can deploy containers to Kubernetes or any of the managed Kubernetes platforms, such as Azure Kubernetes Service (AKS), AWS Elastic Kubernetes Service (EKS), or Google Kubernetes Engine (GKE). Azure also has Container Instances, while AWS has App Runner, and Google has Cloud Run.
Related posts
- Dockerize and Deploy a NodeJS Application to Cloud Run with GitHub Actions
- Automating Tag Creation, Release, and Docker Image Publishing with GitHub Actions
- Where do you commit files for containers that run CI scripts?
- Automate Docker Image Builds and Push to Docker Hub Using GitHub Actions 🐳🐙
- One Dockerfile is all it takes, falling in love with bake