Deployment recipe for Drupal projects. Used for image-based, non-Kubernetes deployments.
- Clone this repository
- echo a HASH OF RANDOM 80 CHARACTERS > ./var/default/drupal-hash-salt.txt
cp etc/example.env .env
# Customize variablescp etc/example.app.env .app.env
# Customize variablescp etc/docker-compose.override.yml docker-compose.override.yml
docker-compose up
- Configure NGINX/Apache on the host to forward traffic to this stack
Notes:
- When pulling in this repo look for changes the two env files
docker-compose.override.yml
is optional and can be used for debugging or extra mounts.
If you need to execute the commands using sudo
, you can create a file to enable sudo without password in /etc/sudoers.d/drupal-deploy-project
ALL ALL = NOPASSWD:/path/to/project/folder/deploy-test.sh
ALL ALL = NOPASSWD:/path/to/project/folder/deploy-prod.sh
ALL ALL = NOPASSWD:/path/to/project/folder/sql-dump.sh
- Multiple services can be started using
-f
switch and refer to appropriate YAML files:
docker-compose -f docker-compose.yml -f etc/service.cache.yml -f etc/service.db.yml -f etc/service.memcache.yml up
Or create file start.sh
and stop.sh
wrapper around the command.
- The hosted Drupal project must have the actions configured, see https://github.com/eaudeweb-skunkworks/template-drupal-deploy-docker
- Create a new Docker HUB repository to host images
- Configure secrets in the Drupal repository, i.e. https://github.com/ORG/PROJECT/settings/secrets/actions:
DOCKERHUB_REPOSITORY
,DOCKERHUB_TOKEN
,DOCKERHUB_USERNAME
- Merge to
test
to create test image, add a new tag to createprod
image