Search code examples
phpreactjsgcloud

How to host React and PHP application on gcloud?


I want to host an application google cloud that is built in React and the backend is in PHP. I want to know how to do it? Is there any way to do that? Can we write runtime: node and PHP both on the app.YAML file?


Solution

  • Hmmm... It technically is possible to do this, but you would be deploying two separate app services. One for the React Frontend, and one for the PHP backend. This would likely require an App Engine Flexible deployment.

    Each service would be associated with a Dockerfile, which means you can have one for React and another for PHP, and connect them; because this is internally run with k8s (the shortened way of spelling Kubernetes), they can contact eachother through the default network (172.16.0.0/16).

    Just remember to name each service differently!