diff --git a/README.md b/README.md index c3afa75..1355231 100644 --- a/README.md +++ b/README.md @@ -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) @@ -63,6 +64,11 @@ version: '2' services: [...] ``` + +## 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 ## Workspace diff --git a/_examples/simple-web/README.md b/_examples/simple-web/README.md new file mode 100644 index 0000000..9e1560b --- /dev/null +++ b/_examples/simple-web/README.md @@ -0,0 +1,21 @@ +## Simple Web Service + +### Setup + +Copy the index file in this folder to the project root: + +```bash +cd / + +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! \ No newline at end of file diff --git a/_examples/simple-web/index.js b/_examples/simple-web/index.js new file mode 100755 index 0000000..05b3fdd --- /dev/null +++ b/_examples/simple-web/index.js @@ -0,0 +1,8 @@ +var express = require('express'); +var app = express(); + +app.get('/', function(req, res) { + res.send('You are amazing'); +}); + +app.listen(8000); diff --git a/_examples/simple-web/package.json b/_examples/simple-web/package.json new file mode 100644 index 0000000..8f8cf21 --- /dev/null +++ b/_examples/simple-web/package.json @@ -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" + } +}