Skip to content

Commit

Permalink
Merge pull request #39 from philtrep/example-simple
Browse files Browse the repository at this point in the history
Example simple
  • Loading branch information
philtrep authored Oct 14, 2016
2 parents db426bf + a34938e commit bdcb573
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 0 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Docker Compose for Node projects with Node, MySQL, NGINX and Certbot images
- [Requirements](#Requirements)
- [Installation](#Installation)
- [Usage](#Usage)
- [Examples](#Examples)
- [Workspace](#Workspace)
- [HTTPS](#HTTPS)
- [Self-signed certificates](#SelfSigned)
Expand Down Expand Up @@ -63,6 +64,11 @@ version: '2'
services:
[...]
```
<a name="Examples"></a>
## Examples
We provide examples of configurations you might use for a specific stack. Each example has it's own README file with instructions.

* [Simple Web](https://github.com/Osedea/nodock/tree/master/_examples/simple-web) - Node + NGINX

<a name="Workspace"></a>
## Workspace
Expand Down
21 changes: 21 additions & 0 deletions _examples/simple-web/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
## Simple Web Service

### Setup

Copy the index file in this folder to the project root:

```bash
cd <project_folder>/

cp nodock/_examples/simple-web/index.js .
cp nodock/_examples/simple-web/package.json .
```

### Usage

```bash
cd nodock/
docker-compose up -d node nginx
```

By going to `127.0.0.1` in your browser you should be seeing a nice greeting!
8 changes: 8 additions & 0 deletions _examples/simple-web/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
var express = require('express');
var app = express();

app.get('/', function(req, res) {
res.send('You are amazing');
});

app.listen(8000);
14 changes: 14 additions & 0 deletions _examples/simple-web/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "example-simple-web-node-docker",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "MIT",
"dependencies": {
"express": "^4.14.0"
}
}

0 comments on commit bdcb573

Please sign in to comment.