Answer the question
In order to leave comments, you need to log in
Do different development and production environments break the Docker concept?
The point of docker is to do everything 1 in 1 as in production, but while you are developing, you need to connect php.ini-development, not production. xdebug. Composer. NodeJs is needed to compile resources. Forward the local user so that there are files in the volume not from under the root.
You don't need any of this in production.
It turns out different docker-composes, different Dockerfiles (although I heard about multi-stage, yes), different forwarded configs? Have an example of a well-written boilerplate php application with docker?
Answer the question
In order to leave comments, you need to log in
The dev environment almost never has the same image as the prod one. But docker allows you to get very close to the production using inheritance. That is, prod is inherited from, say, php:7.3.3-fpm, installs the necessary modules and php.ini options, and the dev image is inherited from prod and installs xdebug, composer, node, modifies only the php.ini options necessary for the dev.
Such an organization allows you to almost not spend time updating the dev image. Prod has changed - dev has also been rebuilt into one command. Very comfortably.
The root of the entire hierarchy will be this base prod image, which does not contain any project files. dev and images with a packaged application are already inherited from it. Mount the working directory of the project into a container based on the dev image and work as you like.
The inheritance hierarchy looks something like this:
php:7.3.3-fpm
└─ prod:base
├─ dev:latest
├─ prod:0.0.1
├─ prod:0.1.15
└─ prod:1.0.4
└─ prod:latest (плавающий тег, указывающий
на самый свежий релиз)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question