-
Notifications
You must be signed in to change notification settings - Fork 1.2k
docs(deployment): instructions to deploy on gcloud app engine standard edition #2742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 12 commits
3422ce5
edc25c5
0a0ee50
baa0af2
096abb2
b2dd33e
dcd97f0
fe3cdb1
de78cee
a28fb18
3319ed6
5c39862
47656fc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
|
||
The following are the instructions to deploy the angular-fullstack app to Google Cloud App Engine Standard Environment | ||
|
||
# Prequsites | ||
## 1. Google Cloud SDK | ||
Download and install [Google Cloud SDK](https://cloud.google.com/sdk/) | ||
## 2. Create GCP Project | ||
```bash | ||
gcloud projects create PROJECT_ID | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd mention that |
||
``` | ||
## 3. Enable Billing | ||
```bash | ||
gcloud alpha billing projects link my-project \ | ||
--billing-account 0X0X0X-0X0X0X-0X0X0X | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Explain where this code comes from, and perhaps post a direct link to the web page for enabling billing |
||
``` | ||
## 4. Create a MongoDB database | ||
Create a MongoDB instance and obtain the uri and credentials | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps add a link for creating a Mongo server |
||
|
||
# Deployment Setup | ||
## 1. Set Node / NPM versions | ||
GCloud App Engine supports only the newest version of Node.js 8 | ||
```javascript | ||
"engines": { | ||
"node": " =8.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
"npm": "^5.1.1" | ||
}, | ||
``` | ||
|
||
## 2. Create Application configuration file (app.yaml) | ||
A Node.js app in App Engine is configured through a file named app.yaml, that contains runtime, handlers, | ||
scaling, and other general settings including environment variables. | ||
|
||
2.1 create a 'app.yaml' file with the following contents | ||
|
||
```javascript | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is YAML, not javascript |
||
|
||
env: standard | ||
|
||
runtime: nodejs8 | ||
|
||
env_variables: | ||
MONGODB_URI: "mongodb://<dbuser :<dbpassword @<environment_URI/deployment_name" | ||
|
||
``` | ||
|
||
2.2 Add app.yaml to .gitignore | ||
|
||
# Deployment Steps | ||
## 1. Build the app | ||
```bash | ||
gulp build | ||
``` | ||
## 2. Copy app.yaml to dist | ||
```bash | ||
copy app.yaml dist | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. bash copy command would be |
||
``` | ||
## 3. Change to build directory | ||
```bash | ||
cd dist | ||
``` | ||
## 4. Deploy | ||
```bash | ||
gcloud app deploy | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove leading spaces so this text doesn't get put into a code block