You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-18Lines changed: 9 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
This is a basic boilerplate for the MEAN stack ([MongoDB](https://www.mongodb.org/), [Express](http://expressjs.com/), [AngularJS](https://angularjs.org/) and [Node.js](https://nodejs.org)) on [IBM Cloud](https://cloud.ibm.com).
4
4
5
-
This application uses the [IBM Cloud Databases for MongoDB service](https://cloud.ibm.com/catalog/services/databases-for-mongodb) and [Node.js runtime](https://cloud.ibm.com/docs/runtimes/nodejs?topic=Nodejs-nodejs_runtime) on IBM Cloud.
5
+
This application uses [Databases for MongoDB](https://cloud.ibm.com/catalog/services/databases-for-mongodb) and [Code Engine](https://cloud.ibm.com/codeengine) on IBM Cloud.
6
6
7
7
The code and detailed steps are discussed in the [IBM Cloud solution tutorial](https://cloud.ibm.com/docs/solution-tutorials?topic=solution-tutorials-tutorials) titled [Modern web application using MEAN stack](https://cloud.ibm.com/docs/solution-tutorials?topic=solution-tutorials-mean-stack).
8
8
@@ -21,13 +21,12 @@ The code and detailed steps are discussed in the [IBM Cloud solution tutorial](h
21
21
## Application Requirements
22
22
-[Node.js & NPM](https://nodejs.org/en/download/)
23
23
-[IBM Cloud Databases for MongoDB](https://cloud.ibm.com/catalog/services/databases-for-mongodb)
24
-
-[Cloud Foundry Command Line Tool](https://docs.cloudfoundry.org/devguide/installcf/)
24
+
-[Code Engine Command Line Tool](https://cloud.ibm.com/docs/codeengine?topic=codeengine-cli)
| [**manifest.yml**](./manifest.yml) | File that defines deployment paramaters. [More info here](http://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html)
31
30
| [**.env.example**](./.env.example) | Set custom [environment variables](https://en.wikipedia.org/wiki/Environment_variable) for your application. This is the proper way to store credentials and other sensitive values.
32
31
| [**server.js**](./server.js) | Main server file that the Node.js runtime uses. It contains all the server logic.
33
32
| [**/server**](./server) | Folder for files used by the Node.js server
@@ -50,9 +49,9 @@ There is also generous commenting throughout the application which helps explain
50
49
1. Open application directory in your terminal and run `npm install`
51
50
1. If you don't have an account, [create a free one here](https://cloud.ibm.com).
52
51
1. Login to your account via the command line: `ibmcloud login`
53
-
1. Target your account ORG and SPACE `ibmcloud target --cf`
54
-
1. Create the instance of IBM Cloud Databases for MongoDB on IBM Cloud: `ibmcloud cf create-service databases-for-mongodb standard mean-starter-mongodb`
55
-
1.Rename`.env.example` file to `.env` and run `ibmcloud cf service-key mean-starter-mongodb "Service credentials-1"` for MONGODB_URL and CERTIFICATE_BASE64. Choose your own SESSION_SECRET.
52
+
1. Target your desired region `ibmcloud target -r ca-tor`
53
+
1. Create the instance of Databases for MongoDB on IBM Cloud: `ibmcloud resource service-instance-create mean-starter-mongodb databases-for-mongodb standard ca-tor`
54
+
1.Copy`.env.example` file to `.env`. Edir `.env` to fill it the required values. You can run `ibmcloud resource service-key-create mean-starter-mongodb-key --instance-name mean-starter-mongodb` to obtain the MONGODB_URL and CERTIFICATE_BASE64. Choose your own SESSION_SECRET.
56
55
1. Run `node server.js` to start your app
57
56
1. Open a browser to the link provided in the terminal prompt to view your app
58
57
@@ -65,26 +64,18 @@ An alternative way of running locally is using the provided `Dockerfile`.
65
64
```
66
65
- Run the app locally
67
66
```
68
-
docker run -p 8080:8080 -ti mean-stack:v1.0.0
67
+
docker run -p 8080:8080 --env-file .env -ti mean-stack:v1.0.0
69
68
```
70
69
71
70
## Contribute
72
71
Please create a pull request with your desired changes.
73
72
74
73
## Troubleshooting
75
-
The primary source of debugging information for your app is the logs. To see them, run the following Cloud Foundry command using the IBM Cloud CLI:
74
+
The primary source of debugging information for your app running in the cloud are the logs. To see them, use the [Code Engine](https://cloud.ibm.com/codeengine/projects) wbe interface.
76
75
77
-
```
78
-
$ ibmcloud cf logs <application-name> --recent
79
-
```
80
-
81
-
If you are not sure what your application name is, use this command to print your application name(s):
82
-
83
-
```
84
-
$ ibmcloud cf apps
85
-
```
76
+
<imgsrc="ReadME-Images/log-mon.png">
86
77
87
-
For more detailed information on troubleshooting your application, see the [Troubleshooting section](https://cloud.ibm.com/docs/cloud-foundry-public?topic=cloud-foundry-public-ts-cf-apps) in the documentation.
78
+
For more detailed information on troubleshooting your application, see the [Troubleshooting apps section](https://cloud.ibm.com/docs/codeengine?topic=codeengine-troubleshoot-apps) in the documentation.
88
79
89
80
## License
90
81
See [LICENSE.MD](https://github.com/IBM-Cloud/nodejs-MEAN-stack/blob/master/LICENSE.md) for license information.
- Install docker on your machine and build the docker image
7
+
```
8
+
docker build . -t mean-stack:v1.0.0
9
+
```
10
+
- Run the app locally to verify it works as expected
11
+
```
12
+
docker run -p 8080:8080 --env-file .env -ti mean-stack:v1.0.0
13
+
14
+
- Login to your container registry.
15
+
> Note: If using the IBM Cloud Container registry, don't forget to use `ibmcloud cr login`
16
+
17
+
- Tag the image with your container registry's namespace/repository name.
18
+
> Note:For IBM Cloud Container Registry in the US: `docker tag mean-stack:v1.0.0 us.icr.io/<namespace>/mean-stack:1.0.0`
19
+
20
+
- Push the image.
21
+
> Note: For IBM Cloud Container Registry in the US: `docker push mean-stack:v1.0.0 us.icr.io/<namespace>/mean-stack:1.0.0`
22
+
23
+
- If you are using IBM Cloud Code Engine to run your container image and the containter registry used is the IBM Cloud Container Registry or a non-Public registry, you will be required to setup a secret for reading the image. Follow the steps outlined in here: https://cloud.ibm.com/docs/codeengine?topic=codeengine-add-registry to do just that.
0 commit comments