This PR enables the df-docker image to be configurable via environment variables which makes it possible to use the same image for different installations/environments (prod, staging..) and for using an external MySQL db aswell as a linked mysql container.
And using Redis as cache or not. It doesnt matter, the image stays the same.
Its also very helpful to use it via docker-compose like so
or by passing the env vars via docker run.... -e DB_HOST=mysql.acme.com etc..
or using the image with a docker orchestrator like mesos/kubernetes/AWS ECS/etc
There are more configs (memcache..) that could be set like this but as we dont need them, I havent added them. But my changes give everyone enough of an idea on how to add them easily.
If no APP_KEY is passed in, a new one is generated.
PS: I know there is php artisan dreamfactory:setup command which could be used instead of sed but "my approach" gives one better control over whats really going on in a container and a basic dreamfactory:setup run is already done in the Dockerfile = resulting image.
This PR enables the df-docker image to be configurable via environment variables which makes it possible to use the same image for different installations/environments (prod, staging..) and for using an external MySQL db aswell as a linked mysql container. And using Redis as cache or not. It doesnt matter, the image stays the same.
Its also very helpful to use it via docker-compose like so
or by passing the env vars via
docker run.... -e DB_HOST=mysql.acme.com etc..
or using the image with a docker orchestrator like mesos/kubernetes/AWS ECS/etcThere are more configs (memcache..) that could be set like this but as we dont need them, I havent added them. But my changes give everyone enough of an idea on how to add them easily.
If no APP_KEY is passed in, a new one is generated.
PS: I know there is
php artisan dreamfactory:setup
command which could be used instead ofsed
but "my approach" gives one better control over whats really going on in a container and a basicdreamfactory:setup
run is already done in the Dockerfile = resulting image.