DEV Community

Cover image for Dockerizing Laravel (With compose) [Alpine + NGINX + PHP FPM + MariaDB + PHPMyAdmin] 🛳️🛳️

Dockerizing Laravel (With compose) [Alpine + NGINX + PHP FPM + MariaDB + PHPMyAdmin] 🛳️🛳️

Adnan Babakan (he/him) on January 11, 2024

Hey there DEV.to community! In the last part, we've covered how to dockerize a Laravel app. That was a great way to know how stuff goes around in ...
Collapse
 
mprajescu profile image
Mihai

This is a great article. Are you planning on expanding this article and build more with Redis, and setup Redis Queues and Laravel Horizon?

How do you rebuild the image with updated code without affecting currently deployed data and do migrations?

Collapse
 
adnanbabakan profile image
Adnan Babakan (he/him)

Yeah sure. I am planning on extending the docker set up for a full Laravel experience!

Collapse
 
mprajescu profile image
Mihai

I've just seen FrankenPHP that works in Beta with Octane. Maybe you want to look into that and setting up Laravel 11 which is around the corner, with FrankenPHP and Octane and docker as a single image that can be setup with multiple containers including redis and mysql for a full setup experience.
It would be great to see how updates and migrations are being pushed when you roll out an update to the docker images.

Collapse
 
sontus profile image
Sontus Chandra Anik

Thanks for this great article. I face a problem when run
docker build -t container_name
show this error

ERROR: "docker buildx build" requires exactly 1 argument.
See 'docker buildx build --help'.

Usage:  docker buildx build [OPTIONS] PATH | URL | -

Start a build
Enter fullscreen mode Exit fullscreen mode

how can solve it. please help me.

Collapse
 
adnanbabakan profile image
Adnan Babakan (he/him) • Edited

Hi!
The command you are entering seems wrong.
The docker build requires an address to build. So make sure to include a . (dot) at the end to build the current directory:

docker build -t image_name .
Enter fullscreen mode Exit fullscreen mode

Let me know if this didn't solve your problem.