How to run a Nestjs Monorepo on Google App Engine?

Viewed 15

I have a vanilla nestjs monorepo that I am failing to run on Google App Engine. We first have to deploy a default service on GAE which I have attempted to do by taking the default nest app (my-app) in the monorepo and adding my app.yaml config and also a cloudbuild.json config file. The project looks like this:

apps
    my-app
        src
            app.controller.ts
            app.module.ts
            app.service.ts
            main.ts
            tsconfig.app.json
            app.yaml // GCP config file
            clouldbuild.json // GCP config file
   my-project
         src
            app.controller.ts
            app.module.ts
            app.service.ts
            main.ts
            tsconfig.app.json
nest-cli.json
package.json
tsconfig.json
node_modules

The error I get is when I deploy to GAE is :

no such file or directory, open '/workspace/package.json'

I guess this is because the package.json is not at the same level as app.yaml. However as this is a monorepo and the package.json is shared across apps how should I configure GAE and Cloud Build to read the package.json from the root folder but only deploy the service in app.yaml? The app.yaml according to gcp docs the app.yaml has to be at the same level as the source files. GCP docs link

0 Answers
Related