Files
erp-efintel-2026-portainer/patch_compose.py
T

33 lines
814 B
Python

import yaml
with open('docker-compose.yml', 'r') as f:
data = yaml.safe_load(f)
data['services']['tax-api'] = {
'build': {
'context': './tax_api',
'dockerfile': 'Dockerfile'
},
'restart': 'unless-stopped',
'networks': ['controlmc_proxy', 'internal'],
'mem_limit': '256m'
}
with open('docker-compose.yml', 'w') as f:
yaml.dump(data, f, sort_keys=False, default_flow_style=False)
with open('docker-compose.local.yml', 'r') as f:
data_local = yaml.safe_load(f)
data_local['services']['tax-api'] = {
'build': {
'context': './tax_api',
'dockerfile': 'Dockerfile'
},
'ports': ['8001:8000'],
'mem_limit': '256m'
}
with open('docker-compose.local.yml', 'w') as f:
yaml.dump(data_local, f, sort_keys=False, default_flow_style=False)