+105
-13
Diff
round #0
+1
README.md
+1
README.md
···
1
+
# Repository listing all stuff created for Docker training
+18
assignment-problem/instructions.txt
+18
assignment-problem/instructions.txt
···
1
+
Dockerize BOTH apps - the Python and the Node app.
2
+
3
+
1) Create appropriate images for both apps (two separate images!).
4
+
HINT: Have a brief look at the app code to configure your images correctly!
5
+
6
+
2) Launch a container for each created image, making sure,
7
+
that the app inside the container works correctly and is usable.
8
+
9
+
3) Re-create both containers and assign names to both containers.
10
+
Use these names to stop and restart both containers.
11
+
12
+
4) Clean up (remove) all stopped (and running) containers,
13
+
clean up all created images.
14
+
15
+
5) Re-build the images - this time with names and tags assigned to them.
16
+
17
+
6) Run new containers based on the re-built images, ensuring that the containers
18
+
are removed automatically when stopped.
+7
assignment-problem/node-app/Dockerfile
+7
assignment-problem/node-app/Dockerfile
+14
assignment-problem/node-app/package.json
+14
assignment-problem/node-app/package.json
+11
assignment-problem/node-app/server.js
+11
assignment-problem/node-app/server.js
+5
assignment-problem/python-app/Dockerfile
+5
assignment-problem/python-app/Dockerfile
+31
assignment-problem/python-app/bmi.py
+31
assignment-problem/python-app/bmi.py
···
1
+
print('(1) Metric (m, kg) or (2) Non-Metric (ft, pounds)?')
2
+
3
+
chosen_system = input('Please choose: ')
4
+
5
+
if (chosen_system != '1' and chosen_system != '2'):
6
+
print('You have to choose either metric or non-metric. Shutting down...')
7
+
exit()
8
+
9
+
height_unit = 'meters'
10
+
weight_unit = 'kilograms'
11
+
12
+
if (chosen_system == '2'):
13
+
height_unit = 'feet'
14
+
weight_unit = 'pounds'
15
+
16
+
print('Please enter your height in ' + height_unit)
17
+
user_height = float(input('Your height: '))
18
+
19
+
print('Please enter your weight in ' + weight_unit)
20
+
user_weight = float(input('Your weight: '))
21
+
22
+
adj_height = user_height
23
+
adj_weight = user_weight
24
+
25
+
if (chosen_system == '2'):
26
+
adj_height = user_height / 3.28084
27
+
adj_weight = user_weight / 2.20462
28
+
29
+
bmi = adj_weight / (adj_height * adj_height)
30
+
31
+
print('Your body-mass-index: ' + str(bmi))
-6
first-demo-starting-setup/Dockerfile
-6
first-demo-starting-setup/Dockerfile
+1
-6
nodejs-first-starting/Dockerfile
+1
-6
nodejs-first-starting/Dockerfile
+1
-1
nodejs-first-starting/server.js
+1
-1
nodejs-first-starting/server.js
+5
python-app-starting-setup/Dockerfile
+5
python-app-starting-setup/Dockerfile
+11
python-app-starting-setup/rng.py
+11
python-app-starting-setup/rng.py
···
1
+
from random import randint
2
+
3
+
min_number = int(input('Please enter the min number: '))
4
+
max_number = int(input('Please enter the max number: '))
5
+
6
+
if (max_number < min_number):
7
+
print('Invalid input - shutting down...')
8
+
else:
9
+
rnd_number = randint(min_number, max_number)
10
+
print(rnd_number)
11
+