I am developing nodejs web app and trying to run it in the Google cloud.
Only files in the root folder get deployed to Google App Engine using gcloud app deploy
command.
The appengine/express sample app depends on subfolders and doesn't work when deployed
Steps to reproduce:
- create simple app with package.json, app.yaml, app.js
- create some folders, put some files in them
- install gcloud, run gcloud app deploy from application folder
- if you required any local modules located in a subfolder, deployment will fail
- if your deployment was successful, go to google cloud console, app engine, versions, click on number in Instances column - you will see a list of instances, on the right click ssh.
- in the ssh console run "
container_exec gaeapp /bin/bash
", then "cd app
", then "ls
" - you will see that no folders were deployed with the application
Is this a problem with the environment, gcloud utility or am I doing something wrong?
gcloud app deploy
respects two lists of subfolders to skip when uploading files:Any
.dockerignore
file in the directory. With thenodejs
runtime, one is created for you containing the following entries:The
skip_files
entry in yourapp.yaml
file. By default, files matching the following regular expressions are matched:If the missing directories don't match either of these, then there might be another issue. You should file an issue here and attach the logs associated with the deployment (in the location given by
gcloud info --format="value(logs.logs_dir)"
) after scrubbing personal data.That said, I just tried to deploy the
appengine/express
sample in the node.js samples for App Engine and was able to do so without any issues with version 138.0.0 of the Cloud SDK.