Skip to content

Commit 57a76a8

Browse files
author
ReToCode
committed
initial commit
1 parent 8405449 commit 57a76a8

File tree

4 files changed

+34
-1
lines changed

4 files changed

+34
-1
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
# docker-paas
21
Collection of hands on for workshops about docker, PaaS, Openshift, Kubernetes

docker/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Docker hands on
2+
3+
## Build a docker image
4+
cd web-app
5+
docker build .
6+
7+
## Run a docker image
8+
docker run retocode/web-app:v1
9+
10+
11+

docker/web-app/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
FROM node:10
2+
3+
WORKDIR /usr/src/app
4+
5+
COPY index.js ./
6+
7+
EXPOSE 3000
8+
9+
CMD [ "node", "/usr/src/app/index.js" ]

docker/web-app/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
const http = require('http');
2+
3+
const port = 3000;
4+
const hostname = '0.0.0.0';
5+
6+
const server = http.createServer((req, res) => {
7+
res.statusCode = 200;
8+
res.setHeader('Content-Type', 'text/plain');
9+
res.end('Hello from Application \n' + process.env.VERSION);
10+
});
11+
12+
server.listen(port, hostname, () => {
13+
console.log(`Server is running on port ${port}.`);
14+
});

0 commit comments

Comments
 (0)