Skip to content

Commit 9526dba

Browse files
committed
Initial commit
0 parents  commit 9526dba

File tree

6 files changed

+64
-0
lines changed

6 files changed

+64
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM node:lts
2+
WORKDIR /usr/src/app
3+
COPY package*.json ./
4+
RUN npm install --production --silent
5+
COPY . ./
6+
EXPOSE 8080
7+
CMD [ "node", "index.js" ]

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 ScaleDynamics
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Docker
2+
3+
This is a project used in the getting started where you'll learn how to create and deploy a basic web server with Docker you can call from HTTP.
4+
5+
See [Getting started for Docker](https://docs.scaledynamics.com/docs/getting-started/docker).

index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const express = require('express');
2+
const app = express();
3+
4+
const port = process.env.PORT || 8080;
5+
6+
app.get('/:name?', (req, res) => {
7+
const name = req.params.name || 'World';
8+
const version = process.version;
9+
res.send(`Hello ${name} from Node.js ${version}`);
10+
});
11+
12+
app.listen(port, () => {
13+
console.log(`HTTP server listening on port ${port}`);
14+
});

package.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "my-docker",
3+
"version": "1.0.0",
4+
"author": "ScaleDynamics",
5+
"license": "MIT",
6+
"main": "index.js",
7+
"scripts": {
8+
"start": "node ."
9+
},
10+
"dependencies": {
11+
"express": "^4.17.2"
12+
},
13+
"devDependencies": {
14+
"warp": "^4.0.19"
15+
}
16+
}

0 commit comments

Comments
 (0)