clientPath = './' targetPath = '/srv/www/simple-calorie-tracker' host = 'mightyserver' all: build setup: npm i --prefix ${clientPath} build: npm run build --prefix ${clientPath} ensure-target-directories: ssh ${host} mkdir -p ${targetPath} deploy-web: ensure-target-directories rsync -vzruc --delete-before -e ssh ./dist ${host}:${targetPath}/ deploy-server: ensure-target-directories rsync -vzruc --delete-before -e ssh ./{nginx, docker-compose.yml} ${host}:${targetPath}/ ssh ${host} mkdir -p ${targetPath}/log build-and-deploy: build deploy-server stop-server: ssh ${host} docker-compose -f ${targetPath}/docker-compose.yml down start-server: deploy-server ssh ${host} docker-compose -f ${targetPath}/docker-compose.yml up -d --build stop-and-clean: ssh ${host} docker-compose -f ${targetPath}/docker-compose.yml down --rmi local --remove-orphans -v