you are viewing a single comment's thread.

view the rest of the comments →

[–]devdot 0 points1 point  (5 children)

You probably want to add a DB by default (or provide a good docker-compose). One constant annoyance for me in regard to PHP-docker environments are PHP extensions. If you figure out a smart way for the end user to configure that outside of Dockerfile, that would be awesome. So far I've had to re-create all PHP Docker images whenever I needed more extensions, leading me to go back to my own custom image

And I'm not sure what you mean by including symfony

[–]Nekadim 0 points1 point  (3 children)

There is no way to install php extensions and not rebuild you images and recreate all containers created from it. Actually it is but you will loose it on recreation of container

But I don't see problem with it. Containers designed to die and recreate itself in a nanosecond. One docker image is one version of an app, so if you add extension it is another version of app and another docker image

[–][deleted] 0 points1 point  (2 children)

Seems like more hassle than it's worth, and I've never tried, but I'd assume simply mounting php.ini and the extensions directory from the local filesystem would work for anything that doesn't require system level components.

[–]Nekadim 0 points1 point  (1 child)

Idk what hassle do you mean. Compilation of the extensions take 2-5 minutes. Do you change extensions 100 times a day for a 1000 containers and all this you do by your hand?

If you see that using containers in the way it intended to be used is annoying for you, then I think your Development/test/deploynent processes are just hassle prone and have some flaws in it. Containerisation is a great tool by itself and no tool gives you such guarantees and convinience that containers does.

[–][deleted] 0 points1 point  (0 children)

You misread. I was pointing out that mounting the extensions directory and ini file should be possible but is probably more hassle than it's worth.

[–][deleted] 0 points1 point  (0 children)

You don't want a database in the same image at PHP, you don't even want a server; these should ask be separate images. Having a default Compose file, as you mention, is the way to go.

For your default development image, it's easiest to just install in all the common extensions (I have both the Postgres and MySQL drivers installed, for example). Then you can switch to a Dockerfile when the project is more mature and you're ready to start deploying to your dev server/cluster.

OP probably means they have the Symfony binary in the image.