-
Notifications
You must be signed in to change notification settings - Fork 9
How to deploy new docker compose application
Robert O'Connor edited this page Oct 10, 2017
·
11 revisions
- Review, approve and merge pull request
- Using ansible vault, create a
.env
file overriding every necessary credentials. Use randomly generated strings with at least 30 chars.ansible-vault encrypt .env
(vault shared passphrase in in lastpass, also encrypted with git-crypt in main ansible repository). - After choosing the host to deploy, verify there's no other service on the port exposed by the docker-compose app. If so, change it to some other port.
- If your application should generate backups, you need to add to the docker-compose file. Check for example openmrs/cron-backup container.
- If desired DNS or the docker host don't exist already, create it using terraform. Details in Provision-new-machine.
-
Edit ansible host_var files:
- add to
docker_deployment
array - add to
docker_deployable_images
(if using docker autodeploy) - add DNS to
letsencrypt_cert_domains
- add new server to nginx configuration (redirect on 80, service on 443 and acme-challenge location for letsencrypt).
- If deploying images will happen Bamboo build (ssh, synchronous), make sure
bamboo
user can ssh into the host.
- add to
-
Make sure inventory should have
docker
,web
, andweb-tls
. If groupbackup
is used, the docker data will be stored in '/data', which is a mounted volume - and should be persisted even if the VM is recreated.
- Automatic deployment of new images can be done in two different ways:
- Create a Bamboo build to execute the
sudo deploy-compose <your-compose>
, like https://ci.openmrs.org/browse/DEMO-RD . - Configure autodeploy using a webhook in Dockerhub, like https://hub.docker.com/r/openmrs/openmrs-reference-application-distro/~/settings/webhooks/. The last part of the string will be the token, which can be retrieved in
/root/docker/dockerhub-webhook/.env
on the destination machine.
- Create a Bamboo build to execute the
- To restart it (as a one-off) you can use
deploy-compose <your-compose>
whenever desired.
- Add the servers to pingdom
Read this before updating this wiki.