Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

PetroGromovo's avatar

Which docker source is preferable for installing laravel under docker ?

Hello, I have expierence of installing laravel app under docker from apache, using in Dockerfile.yml command like :

 FROM php:7.3-apache

Also I find some docker apps use package fpm or alpine. What is the difference? Have some sources more packages? Better to tune?

Thanks!

0 likes
3 replies
Tray2's avatar

I'm just starting to learn about docker for laravel but I really recommend this course on it.

https://gumroad.com/l/cwYKw

It covers a lot on developing and on deploying to production

Sinnbeck's avatar

+1 for the course :) But be aware that he does not set up FPM in the apache2 image, meaning it wont work with php-fpm. I have contacted the author, and asked him for to upload an updated version :)

1 like
Sinnbeck's avatar
Sinnbeck
Best Answer
Level 102

Well first of all php:7.3-apache is apache and php in the same container..

The php:7.3-fpm is just php but with FPM (a protocol for communication) enabled. This means that you can move your webserver to a different container. Both nginx and apache2 supports FPM, but if you plan to do this I suggest using nginx as it is WAY easier to setup :)

Regarding alpine, this is just a minimalistic platform to start from. Imagine removing EVERYTHING from linux (only the kernel left).. This makes your images way smaller (the base image is 8 MB I think), but also requires you to install more stuff yourself (and it has its own package manager as well)

1 like

Please or to participate in this conversation.