deploying with docker and cloud-init

 

from: https://contabo.com/blog/the-ultimate-guide-to-docker-installation-and-deployment-using-cloud-init/

need to add the ssl key to connect to the server

#cloud-config package_update: true package_upgrade: true timezone: UTC write_files: - path: /tmp/.env.tpl permissions: '0644' content: | # docker-compose parameters # docker compose project name # url of openimis, FQDN NEW_OPENIMIS_HOST=demo.openimis.org # http port for openimis HTTP_PORT=80 # https port for openimis HTTPS_PORT=443 #DB params DB_PASSWORD=IMISuserP@s DB_USER=IMISuser DB_NAME=IMIS DB_HOST=db DB_PORT=5432 DB_ENGINE=django.db.backends.postgresql # github branches to use # Database, you can use develop branch too DB_BRANCH=main #Gate way, you can use develop branch too GW_BRANCH=main # BE assembly, you can use develop branch too BE_BRANCH=main #FE assembly, you can use develop branch too FE_BRANCH=main # REST API, you can use develop branch too RESTAPI_BRANCH=main # build flavours # rest API flavours RESTAPI_BUILD_FLAVOR=Release users: - name: openimis groups: sudo, docker shell: /bin/bash sudo: ALL=(ALL) NOPASSWD:ALL ssh-authorized-keys: - <YOURKEY> packages: - apt-transport-https - ca-certificates - curl - git - fail2ban - gnupg-agent - software-properties-common runcmd: - set -a; . /etc/environment; set +a; source /var/set-env.sh - mkdir -m 0755 -p /etc/apt/keyrings - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg - echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null - apt-get update -y - apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-compose -y - systemctl start docker - systemctl enable docker - cd /home/openimis/ && git clone --depth 1 https://github.com/openimis/openimis-dist_dkr.git compose - cp /tmp/.env.tpl /home/openimis/compose/.env - docker-compose -f /home/openimis/compose/docker-compose.yml --env-file /home/openimis/compose/.env up -d

Did you encounter a problem or do you have a suggestion?

Please contact our Service Desk



This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License. https://creativecommons.org/licenses/by-sa/4.0/