Skip to content

How to deploy new docker compose application

Robert O'Connor edited this page Oct 10, 2017 · 11 revisions

For Developers

For Infra team

Docker compose Ansible role

  • 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.

Terraform

Ansible main tree

  • 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.
  • Make sure inventory should have docker, web, and web-tls. If group backup 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.

CI/Deployment

Monitoring

  • Add the servers to pingdom
Clone this wiki locally