Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Need help with deploying a React App in Google App Engine [flexible environment]

Hello,

In Google App Engine(GAE), there are two environments on GAE for deploying apps, standard & flexible. Currently, we have six apps / services running on GAE, web app (React) & backend app (both having production, staging & dev environments). All are deployed using the standard environment type on GAE. All are running well.
 
Next, I want to upgrade only the production environments / apps of both web app & backend app to flexible environment type, to increase the performance of the apps for real users. I have attached .yaml file used for deploying both standard & flexible. I tried ensuring the flexible environment .yaml file are as per the docs, but as well deploy the web app using flexible environment, it just doesn't load up. I'm not sure where the issue is. I even tried searching for the solution on the web, but all resources are for standard environment, nothing available for flexible environment.

production.yaml (standard)

 

runtime: nodejs20
service: production-frontend
env: standard
instance_class: B1

manual_scaling:
  instances: 1

runtime_config:
  operating_system: "ubuntu22"
  runtime_version: "20"

handlers:
  - url: /static/(.*)
    static_files: build/static/\1
    upload: build/static/(.*)
    secure: always

  - url: /(.*\.(json|ico|js|html|png|txt|css))$
    static_files: build/\1
    upload: build/.*\.(json|ico|js|html|png|txt|css)$
    secure: always

  - url: /.*
    static_files: build/index.html
    upload: build/index.html
    secure: always

build_env_variables:
  NODE_ENV: production
  NPM_CONFIG_FORCE: true
  GENERATE_SOURCEMAP: false

env_variables:
  NODE_ENV: production
  GENERATE_SOURCEMAP: false
  # MY REACT APP ENVIROMENT VARIABLES​

 


production.flex.yaml

 

runtime: nodejs
service: production-frontend
env: flex

runtime_config:
  operating_system: "ubuntu22"
  runtime_version: "20"

handlers:
  - url: /static/(.*)
    static_files: build/static/\1
    upload: build/static/(.*)
    secure: always

  - url: /(.*\.(json|ico|js|html|png|txt|css))$
    static_files: build/\1
    upload: build/.*\.(json|ico|js|html|png|txt|css)$
    secure: always

  - url: /.*
    static_files: build/index.html
    upload: build/index.html
    secure: always

build_env_variables:
  NODE_ENV: production
  NPM_CONFIG_FORCE: true
  GENERATE_SOURCEMAP: false

env_variables:
  NODE_ENV: production
  GENERATE_SOURCEMAP: false
  # MY REACT APP ENVIROMENT VARIABLES​

 

0 1 154
1 REPLY 1

Next, I want to upgrade only the production environments / apps of both web app & backend app to flexible environment type, to increase the performance of the apps for real users. 

Not a direct answer to your question but I'm curious as to why you think Flexible will provide a better performance than Standard in your use case.

 

it just doesn't load up

Was the deploy successful? Do you get an error when you try to open your App? If so, what is the error? What do you see in your logs?

 

   ......NoCommandLine ......
https://nocommandline.com
        Analytics & GUI for 
App Engine & Datastore Emulator