-
Notifications
You must be signed in to change notification settings - Fork 0
/
5-1.txt
90 lines (65 loc) · 1.25 KB
/
5-1.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//terminal
// vi server.js
/* server.js
var express = require('express');
var app = express();
app.get('/', functin(req, res) {
res.json({'msg': 'some message'})
});
var port = process.env.port || 300;
app.listen(port, function() {
console.log('server started');
});
*/
//terminal
// vi docker-compose.yml
/* docker-compose.yml
webservice:
build: .
ports:
- "3000:80"
environment:
port: "80"
*/
//terminal
// docker-compose up
// docker-compose run webservice
// docker ps
// curl http://localhost:3000
// docker-compose ps
// docker ps
// docker stop service_webservice_run_1
// curl http://localhost:3000
// vi server.js
/* changes to server.js
change res.json msg to 'hello world!'
*/
//terminal
// docker-compose up -d
// curl http://localhost:3000
// docker-compose build webservice
// curl http://localhost:3000
//more terminal
// vi docker-compose.yml
/*
webservice:
build: .
ports:
- "3000:80"
environment:
port: "80"
volumes:
- .:/user/src/app
*/
//terminal
// vi Dockerfile
// vi server.js
// docker-compose up -d
// curl http://localhost:3000
// docker stop 19868a4cae3b
// vi server.js
// docker-compose up -d
// curl http://localhost:3000
// docker ps
// docker exec -it 44262af7e8eb /bin/bash
// touch tempfile