1

I am using Vue CLI 3 to create a web application with the following presets: babel, PWA, Vue Router, and css proprocessors. I am trying to deploy the application on Google Cloud's App Engine. How do I serve this? The tutorial on Google says I just have to do:

gcloud app deploy

in the root directory, but I don't know how to configure app.yaml to deploy the dist/ folder.

1 Answer 1

1

Have you tried deploying your Vue.js app to Google App Engine using Cloud Build? I have had no problem deploying any Vue.js apps in this way. Try following this tutorial for complete instructions.

Basically, you would have to include the following two files in your project root directory when deploying your Vue.js app to Google App Engine via Cloud Build:

  1. App.yaml

runtime: nodejs10
handlers:
  # Serve all static files with urls ending with a file extension
- url: /(.*\..+)$ 
  static_files: dist/\1
  upload: dist/(.*\..+)$
  # catch all handler to index.html
- url: /.*
  static_files: dist/index.html
  upload: dist/index.html

and

  1. cloudbuild.yaml

steps:
- name: node:10.15.1
  entrypoint: npm
  args: ["install"]
- name: node:10.15.1
  entrypoint: npm
  args: ["run", "build"]
- name: "gcr.io/cloud-builders/gcloud"
  args: ["app", "deploy"]
timeout: "1600s"

In the case you're not using cloud build you may just reference the app.yaml above and the configuration should be sufficient for your case.

Sign up to request clarification or add additional context in comments.

2 Comments

Please don't write link-only answers.
@highfivebrian for it show Status Step failed Name gcr.io/cloud-builders/gcloud

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.