In my opinion the images provide the perfect balance between a small image size and a rich feature set.All images for each service are developed from the same company which makes configuration easier as all images share the same base and structure.Bitnami offers dozens of images for PHP, MySQL / MariaDB, Redis, Memcached, MongoDB, Node.js and so on.I decided to go with the Bitnami images for some reasons: The stack uses Docker images provided by Bitnami, one of the big players for containerized deployment and hosting. And if you start with a clean setup it makes the process of using Docker in production even easier. If services can only talk to each other trough ports, you probably closed some hundred possible vulnerabilities.Įven if security is not that important for development, you should still keep an eye on it. It doesn't even feel save to have one machine that runs everything, where every service can access everything from all other services. If the architecture of your app changes, you can easily swap services by replacing some lines in your docker-compose.yml file - instead of revisiting your Dockerfile and making sure that your installation still works. Manual installation of services always leads to the problem that the base image has to be updates once a single service was updated or its configuration changed. So, instead of using the PHP base image and installing MySQL, nginx and Redis into it, I am using a service-specific image for each service. Personally I prefer to have every service in a single container, with separate configuration. There are two approaches on developing and deploying Docker-based applications: either you put every used service and configuration into one container or you split up the setup into several Docker containers talking to each other, i.e. Micro-services over monolithic architecture You can find all files of this Docker stack on Github.īefore you start, Docker needs to be installed on your machine. That mans that you can configure PHP, databases and the web server completely to your app requirements without the need to take care of other apps or switching between configurations.Īs most of the projects I work on are developed with plain PHP, a larger Laravel stack or a PHP-based CMS like Wordpress or Drupal, I could easily copy the small Docker stack I configured from one app to another with only single adjustments or - better - no adjustments at all. This leads to not only a more sold security (even if not that important for development only), but also a fixed environment for each app. And the same database server and cache service (like Redis), if used by the application.ĭocker creates isolated container for each application in which only the application runs and has access to. But it has one major flaw: all apps share the same PHP configuration. ![]() ![]() As I think that this stack is quite solid and - most important - very easy to use with only little configuration, I want to share it with you because it rapidly speed up my development process. Over the past months I gradually implemented a solid Docker setup for all private projects. I started using it for bigger projects at work. Then with my first Laravel projects came Homestead but I never get used to it really.įinally, about a year ago, I first tried Docker. ![]() It was quite a hassle to keep everything running with those locally installed PHP version although the MAMP team did an exceptional job with the installation. For a long time I used MAMP Pro to manage my local development environment.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |