DEV Community

Publicar un sitio web con angular en GCP AppEngine Standard

Google Cloud App Engine Standard offers an economical way to deploy static or framework-generated web frontends. This managed solution provides advantages like support for popular languages, advanced diagnostics, version management, and security. To deploy a web page on App Engine, you first need to set up a project in Google Cloud, specifically configuring it for Python and the Standard environment. Next, prepare your local project by adding two crucial files: app.yaml and .gcloudignore. The app.yaml file acts as a deployment descriptor for App Engine, specifying runtime settings and URL handlers for static files and the main index.html. The .gcloudignore file prevents unnecessary files, such as node_modules, from being uploaded to App Engine. After configuring your local project, you'll use the Google Cloud SDK to publish your website. Install the Cloud SDK client and navigate to your project's directory in the shell. First, build your Angular project by running npm install and npm run build. Ensure your Cloud SDK is configured for the correct Google Cloud project by running gcloud info. If the project setting is incorrect, re-initialize the configuration using gcloud init. Once the project is built and the SDK is correctly configured, execute gcloud app deploy. Confirm the deployment with 'Y' in the Cloud SDK shell. Upon successful completion, you will receive confirmation and the access URLs for your deployed service. You can then verify the deployment in the Google Cloud console, where the new version will be assigned 100% of incoming traffic. The example deployment can be accessed at https://deployfrontendweb.rj.r.appspot.com.
favicon
dev.to
dev.to
Create attached notes ...