Docker Community Forums

Share and learn in the Docker community.

General question about building an image for a web appliaction

Hey guy’s

I’m new working with docker and I have a general question about how I should build the image for my project. I’m currently developing a PHP application with laravel and would like to run this thing with docker / docker-compose.

How shoudl I now build the image? An image based on nginx which clonse the git repo with the code during the creation of the image into the wwwroot folder and the image would run and work by it self or just my code based on a php image and a separate nginx server as a image which servers the code out of my php image?

Thank you for your answer.

What i have done, is to run the laravel application using “php artisan serve --host= --port=8080”, and then setup a proxy ( like nginx or traefik ) to handle ssl offloading to the container.

I’m not sure if this is the best solution. “php artisan serve” just starts a dev server and I’m not sure if that should be used as productive server.