wowu / docker-rollout

🚀 Zero Downtime Deployment for Docker Compose
https://github.com/Wowu/docker-rollout
MIT License
2.37k stars 66 forks source link

How to deploy to remote instance #6

Closed fliespl closed 1 year ago

fliespl commented 1 year ago

My deploy command:

docker-compose -H "ssh://owadmin@${DEPLOY_HOST}" --profile app -f docker-compose.yml -f docker-compose.deploy.yml -f docker-compose.${BUILD_ENV}.yml up -d --remove-orphans

Is it possible to do it here? (-H option).

wowu commented 1 year ago

Setting the DOCKER_HOST environment variable should work.

wowu commented 1 year ago

Same thing goes for --profile flag, use COMPOSE_PROFILES env instead.

https://docs.docker.com/compose/environment-variables/envvars/#compose_profiles

fliespl commented 1 year ago

Thank you - will give it a try :) (probably gonna conflict with gitlab ci which also utilizes this variable).

wowu commented 1 year ago

You can do it this way to avoid the conflict:

env DOCKER_HOST="ssh://owadmin@${DEPLOY_HOST}" docker-compose -f docker-compose.yml ...