diff --git a/deploy/portainer/deploy.py b/deploy/portainer/deploy.py index 18be662..7a613e4 100644 --- a/deploy/portainer/deploy.py +++ b/deploy/portainer/deploy.py @@ -7,6 +7,7 @@ import requests import json from dotenv import load_dotenv from string import Template +from pathlib import Path load_dotenv() @@ -77,7 +78,8 @@ else: ### Template substitution for the portainer stack deployment ### portainer_deploy_json = None -with open('portainer_deploy.template.json', 'r') as file: +template_file = f'{Path( __file__ ).parent.absolute()}/portainer_deploy.template.json' +with open(template_file, 'r') as file: portainer_template = Template(file.read()) # Perform variable substitution