In trying to set up a CI/CD process to containerize Craft 3 and deploy to Azure App Service, I succeed in building a container that runs Craft, however, each time the container gets redeployed, I either have to run php craft setup
or the GUI setup again.
To avoid this, I've already set environment variables for the database connections, etc. in the App Service's configuration. I've also tried deploying an empty .env file to the container, or an .env file that contains a single, common setting (CP_TRIGGER=admin
). In both cases, that does not make a difference.
What is the way to get Craft to run in a new environment without requiring a .env file?
The container is built in a multi-stage process, using composer:latest to create a Craft project and then craftcms-nginx:8.1 for the actual container that's deployed.