I decided to start using docker in all my projects, and I'm interested in best practices, when it comes to deployment.
If I have a local docker environment, that is running a php-apache, mysql, and redis service, what's the best strategy when deploying? Do you have a custom docker-compose config for production, which removes the redis and mysql services (assuming you'd want those on their own dedicated server)?
There are a number of viable ways to run PHP containers in production, so it's a little hard to answer your question comprehensively. I'll offer a few options:
As a note on database containers, you can containerize your database, and assuming that you put the actual data in a volume and have a sensible backup system in place there's no reason that containers won't be safe. You probably want to start by running just one container for your database or by using a hosted database service as scaling a database across multiple containers can get complicated (but here's a little bit about how you might do it with MySQL).