I’m trying to deploy a Python Flask app using Firebase App Hosting, but the deployment consistently fails because Google Cloud Build incorrectly detects the app as Node.js, even though everything in the project is configured for Python.
🔧 What I’ve done so far:
Created a
main.pyfile with a valid Flask app (app = Flask(__name__)).Added
requirements.txtwith:Flask gunicorn python-dotenv PyPDF2Tried all the following configurations (separately):
apphosting.yamlwith just:runtime: pythonProcfilewith:web: gunicorn -w 4 -b 0.0.0.0:8080 main:appfirebase.json:{ "apphosting": { "backendId": "mojbackendgetthecall", "source": ".", "runCommand": "gunicorn -w 4 -b 0.0.0.0:8080 main:app", "ignore": ["node_modules", ".git"] } }Even
app.yaml(App Engine format) with:runtime: python entrypoint: gunicorn -w 4 -b 0.0.0.0:8080 main:app
No matter what I try, the build fails with Node.js detection errors, and it never recognizes Python.
❌ Build Error:
======== Output: google.nodejs.runtime@1.0.0 ========
Nodejs version not specified, using the latest available Nodejs runtime for the stack "ubuntu2204"
Opting out: neither package.json nor any .js files found
======== Output: google.config.entrypoint@0.9.0 ========
Opting out: GOOGLE_ENTRYPOINT not set, no valid entrypoint in app.yaml and Procfile not found
======== Results ========
fail: google.nodejs.runtime@1.0.0
fail: google.config.entrypoint@0.9.0
pass: google.utils.label-image@0.0.2
ERROR: No buildpack groups passed detection.
ERROR: failed to detect: buildpack(s) failed with err
ERROR: failed to build: executing lifecycle: failed with status code: 21
ERROR: build step 2 "gcr.io/k8s-skaffold/pack" failed: step exited with non-zero status: 1
📌 What I suspect:
It seems like my Firebase project was originally initialized as a Node.js project, and some internal configuration still "remembers" this – so the Cloud Build system keeps using Node.js buildpacks despite the Python config being present and correct.
❓ Question:
How can I force Firebase / Cloud Build to correctly recognize this as a Python app, not Node.js?
Is there a way to fully reset the backend environment or override detection to guarantee Python is used?
Thanks in advance for any help — I’ve tried everything I could think of.