

It works for us only because we created DigitalOcean droplets with Ubuntu. For example, apt is the package manager on Debian and Debian-based distros (such as Ubuntu or Mint). How do you know that the server has wget and apt. But this is still not really "portable" or platform-independent since the script has things like this: It takes care of installing system dependencies on a new server. This is why you migh have a provision_server.sh script or something similar. The application and the deploy script assume that the server already has php, nginx, mysql, gd and so on.

When you don't use Docker you probably deploy with some shell scripts, and you prepare a new server manually (or running a shell script that install PHP, etc). The most important thing is: package software and its dependencies. Containers are a lightweight and portable way to package software and its dependencies, allowing applications to run consistently across different environments. The deployment folder contains some deployment-related scripts and config files:īefore we start dockerizing the application let me explain what Docker is.ĭocker is a platform that allows us to create, deploy, and run applications in containers. It's a monorepo containing these folders:Īpi contains a standard Laravel app.
Php 8.1 docker how to#
In this article, I'm going to show you how to dockerize an application that has the following components: DevOps With Laravel: Dockerizing a Laravel application
