import os import subprocess subprocess.run("echo 'node version:' && node --version", shell=True) subprocess.run("echo 'npm version:' && npm --version", shell=True) subprocess.run("pwd && ls -al", shell=True) subprocess.run("export PORT='7860'", shell=True) print(f'PORT set to {os.getenv("PORT")}') subprocess.run("npm --prefix app install", shell=True) subprocess.run("npm run build --prefix app", shell=True) subprocess.run("node app/build", shell=True)