WEBVTT

00:05.180 --> 00:05.730
Hi everyone.

00:05.730 --> 00:06.690
Welcome back.

00:06.960 --> 00:14.250
So in this video we're going to finally jump into docker and see how to use it especially on our application

00:14.250 --> 00:14.950
right now.

00:15.060 --> 00:20.850
So if you look at our application right now if you go to that stuff and tutorial one and it's only just

00:20.850 --> 00:28.410
one file app Abdon Dhabi which just has all the logic for the server and you know we now want to start

00:28.440 --> 00:31.960
to change this system into a docker crisis.

00:32.310 --> 00:39.540
Now first of all let's open our system or actually let's leave that till the end and see how you organize

00:39.540 --> 00:42.740
our product first and then see what the requirements are.

00:42.750 --> 00:49.490
Now the first website I want to introduce to you two is Dr. shop and Dogger hub is a place like get

00:49.490 --> 00:58.170
a job as the name might suggest where people store a bunch of darker images that describe different

00:58.170 --> 00:59.040
systems.

00:59.220 --> 01:05.820
So for example if a wall or looking to search for a license anywhere we want a system that has bison.

01:05.940 --> 01:11.220
If we just search for a system that has by then you'll notice here that there is an official image off

01:11.220 --> 01:18.080
by then and I can choose that image up by then so here I click on that and more details.

01:18.630 --> 01:22.170
And so you'll notice here that we have a daquiri image.

01:22.260 --> 01:29.700
And so later on when we're writing the docker file you're going to notice that I'm pulling right away

01:29.700 --> 01:30.580
from my.

01:30.600 --> 01:35.250
And if you're wondering where this is pulling from this is actually where it's falling from.

01:35.250 --> 01:41.220
So there's so many different versions of Python the doctor supports or the official version at least

01:41.870 --> 01:43.580
and you can install any of these.

01:43.590 --> 01:46.770
So we're actually going to be using version number three.

01:46.980 --> 01:51.840
So I just wanted to show you where we are because when we're writing the docker file We're going to

01:51.840 --> 01:53.930
be using from Python's street.

01:54.120 --> 01:58.020
And then you might be wondering well where is he getting this from.

01:58.020 --> 02:04.710
And the answer is from this doctor hub the software ocker itself knows how to get the doctor from from

02:04.710 --> 02:10.830
this place over here from this doctor hub and downloaded onto your local machine without you needing

02:10.830 --> 02:12.480
to do anything.

02:12.600 --> 02:15.120
Now that's you for a doctor out now.

02:15.180 --> 02:20.420
The second thing is we want to start using darker and darker compose.

02:21.290 --> 02:21.960
OK.

02:21.990 --> 02:25.920
So we're going to click on tutorial one and we go in.

02:25.920 --> 02:32.720
And so the first thing the way we're going to be organizing this project is we this this app that DeWyze

02:32.730 --> 02:34.270
actually the web server.

02:34.350 --> 02:38.970
So I'm going to make a new folder here so it's not allowing me.

02:39.350 --> 02:46.300
So up close this and open it again maybe desktop tutorial one.

02:46.470 --> 02:47.010
No.

02:47.170 --> 02:50.300
OK let's try with the termino.

02:50.490 --> 02:58.440
So it's probably just permissions problem so let's go to desktop and then tutorial one.

02:58.500 --> 03:05.500
And so once we're inside we can make a directory and we'll call this directory with.

03:05.540 --> 03:06.160
OK.

03:06.180 --> 03:12.900
So this is where we're going to copy or put all our web application related stuff there.

03:12.990 --> 03:15.750
And so we do.

03:16.020 --> 03:20.290
So that's the.

03:21.090 --> 03:21.640
OK.

03:21.750 --> 03:24.450
So if you're not sure what to do.

03:24.480 --> 03:33.080
Bang bang this is this basically means do the previous operate or command that I just did using sudo.

03:33.090 --> 03:37.500
So it's basically sudo and then just copy this command over here.

03:37.500 --> 03:41.500
So it's much faster than just having to write everything from scratch.

03:41.860 --> 03:49.020
OK so if I have another for if I have for example a database then I would do so to make directory and

03:49.020 --> 03:56.270
then I would make a directory for example such as database D-B.

03:56.310 --> 03:56.900
OK.

03:57.060 --> 04:05.250
So for every different container that you're going to have you have to make a new or folder to store

04:05.250 --> 04:07.110
all the related files to that.

04:07.110 --> 04:11.890
So since we don't have that database for now we're just going to go into web.

04:11.930 --> 04:12.620
OK.

04:12.900 --> 04:18.570
So once we're inside with what we want to do a couple of things we actually want to copy right so we

04:18.570 --> 04:28.280
want Capuzzo to Suder copy and then we want to copy the file from the previous one is called IPY.

04:28.380 --> 04:30.030
And then I want to copy it here.

04:30.260 --> 04:31.210
OK.

04:31.590 --> 04:38.910
So once I've copied my file as I do L.A. and I saw my file you're now Dockery expects to see a file

04:38.910 --> 04:39.850
called docker.

04:39.900 --> 04:45.370
So I'm going to do touch her file and I'm going to explain to you what this is.

04:45.370 --> 04:51.940
In a moment so Ducker always expects in one of these folders to have a file called Doc or file.

04:51.990 --> 04:52.470
OK.

04:52.560 --> 04:56.430
And it has to be spelled in this way and doesn't have any extensions.

04:56.430 --> 04:59.710
OK so you just do touch and then dodgier file.

04:59.940 --> 05:02.270
OK so again you don't.

05:02.670 --> 05:04.500
And now if you do it.

05:04.510 --> 05:08.870
LS We have two files we have added up UI and the knocker file.

05:08.880 --> 05:15.430
Now if you remember in the first few videos are we installed a flask and we installed a flask restful.

05:15.450 --> 05:16.010
Right.

05:16.170 --> 05:23.050
But now we want to tell you that there are some requirements for this web application to run.

05:23.070 --> 05:23.320
Right.

05:23.330 --> 05:25.510
So there are some dependencies.

05:25.510 --> 05:30.980
And so we have to touch requirements requirements that TXI.

05:31.020 --> 05:36.390
And then in this requirements the next year we're going to store all basically all the different libraries

05:36.600 --> 05:39.160
that we need like flask and flask restful.

05:39.270 --> 05:42.860
OK and pseudo again keep her from forgetting it.

05:43.050 --> 05:45.800
And so if we do ls now we have an app that p y.

05:45.810 --> 05:50.370
This is the original application that we wrote and then we have the Dogger file.

05:50.490 --> 05:55.530
And we have that without any extensions and then we have requirements that 60.

05:55.530 --> 05:58.830
Now if we open our sudo at home here.

05:58.950 --> 06:05.400
So let's open an atom in this folder over here to do C and then the first thing is we have free files

06:05.400 --> 06:07.210
right at that p y.

06:07.380 --> 06:13.050
So add up us the same file that we wrote and if you notice you're using flask and flask cresc.

06:13.410 --> 06:18.010
And then Dharker file is just an empty file and requirements XTi.

06:18.030 --> 06:18.520
Right.

06:18.630 --> 06:19.460
OK.

06:19.470 --> 06:25.440
So let's first just jump into dog or file and explain line by line so we're going to read a couple of

06:25.440 --> 06:26.300
lines.

06:26.340 --> 06:31.620
I think we're going to write like five or six lines so it shouldn't be too big and we're going to explain

06:31.620 --> 06:36.560
what each of these lines does in in this what once it starts.

06:36.570 --> 06:42.230
OK so the first thing is we're going to write and write from by then.

06:42.300 --> 06:43.980
So Python 3.

06:44.220 --> 06:47.550
So I'm pulling from Python 3.

06:47.800 --> 06:49.920
So where does this pull from.

06:49.920 --> 06:54.400
Well it pulls from the Web site and I just showed you so it's pulls from the sphere.

06:54.420 --> 06:56.270
This official repository.

06:56.490 --> 07:01.820
So I just do pull from Python 3 so it downloads I three.

07:02.070 --> 07:09.030
OK so once I have this by three actually what you don't know is that the Spice's 3 over here is not

07:09.030 --> 07:12.330
only bytes in but it has a buntu image on top with it right.

07:12.390 --> 07:19.710
So this doctor file doesn't only have up the pipes and installed a pipe and has to have an operating

07:19.710 --> 07:20.850
system with it right.

07:20.930 --> 07:29.040
And so Python 3 has the buntu operating system so when we do this if we was this just a one line what

07:29.040 --> 07:32.990
happens is Ducker pulls this image and it trons.

07:33.030 --> 07:34.900
So this image over here.

07:34.920 --> 07:41.130
So this image on the getup here has its own darker fall so if you notice each of these has a different

07:41.130 --> 07:41.630
doctor.

07:41.680 --> 07:47.500
Also if I click here for example on this Vulg. file you it would take me to.

07:47.640 --> 07:49.180
So this link is OK.

07:49.200 --> 07:50.750
So this link is not broken.

07:50.880 --> 07:56.970
So you would notice here that it actually has another doc or files or if you notice here it's also pulling

07:56.970 --> 07:59.810
from some other images.

07:59.940 --> 08:05.520
And then it's doing a bunch of stuff so so that we have we don't have to write all these bunch of stuff

08:05.700 --> 08:07.860
we just directly pull from it.

08:07.990 --> 08:15.020
And and part of pulling from that Python repository is that it also have an operating system.

08:15.120 --> 08:20.750
So we don't need to define the operating system and everything right can just go right away from bising

08:21.140 --> 08:21.770
from Python.

08:21.770 --> 08:29.500
And so once this line is done then we have a fully working operating system running a buntu.

08:29.690 --> 08:36.370
And it's also running by Sunseri So that was you know super cool very short with just one line of code.

08:36.380 --> 08:42.740
Now the second thing is we're now working inside this docker file over inside this machine.

08:42.740 --> 08:49.370
You can think of the docker file as as giving instructions of how to build a machine from scratch.

08:49.370 --> 08:49.900
Right.

08:50.090 --> 08:56.060
So basically inside this machine right now and I'm building it step by step.

08:56.150 --> 09:04.040
So I'll tell this machine that I want my work directory to be at slash user slash slash user slash source

09:04.040 --> 09:04.980
slash app.

09:05.120 --> 09:05.610
OK.

09:05.750 --> 09:11.060
So what is this so it's basically saying that inside this machine inside this machine that's running

09:11.060 --> 09:11.660
the buntu.

09:11.660 --> 09:16.250
And by then I want my working directory to be user sourced at.

09:16.250 --> 09:22.450
So why why are we treating this well this is just the convention we really work or put our user work

09:22.450 --> 09:25.090
directory in slash or slashed or slash.

09:25.100 --> 09:30.390
This isn't really anything special it's just they the common way people do it.

09:30.680 --> 09:36.640
And so now we can think of it as we have a machine running a buntu with bytes and three.

09:36.660 --> 09:41.800
And our working directories now in this in this here.

09:42.200 --> 09:45.740
Now the second thing we want to do is to copy right.

09:45.740 --> 09:51.950
We have a we want to install that dependencies right before we run our application we want to copy the

09:51.950 --> 09:53.440
requirements that x.

09:53.450 --> 09:56.740
So I'm going to copy and then requirements.

09:57.140 --> 10:04.120
Let's see Rick wired mutants not text and I want to copy it.

10:04.130 --> 10:10.580
So this requirements that decs is copying from here over here from over here and then I'm copying it

10:10.610 --> 10:17.710
all the way to my machine which is running a buntu 16.00 for Python and this is it's working there actually.

10:17.870 --> 10:20.350
So I want to copy it to the current work directory.

10:20.420 --> 10:28.670
So I just added that and then I'm saying run some sync to the machine to the Abunda machine running

10:28.670 --> 10:29.720
by then.

10:29.890 --> 10:36.840
I'm telling it to run Pipp install and then no cache directory.

10:36.860 --> 10:45.890
Make sure there's no cache and then are recursive and then requirements require all these compute this

10:45.890 --> 10:46.550
one Rick.

10:46.670 --> 10:48.330
Why your moments.

10:48.360 --> 10:49.400
Yep there we go.

10:49.450 --> 10:53.440
Requirement is that X so that we're going to tell the machine to run.

10:53.520 --> 10:59.010
And also this machine is up to say it hasn't already passed by then.

10:59.150 --> 11:00.500
So we do it Instow.

11:00.530 --> 11:05.840
No cash there actually to install these requirements that DEXA we're going to install all of these Python

11:06.380 --> 11:07.740
libraries over here.

11:07.790 --> 11:09.930
The dependencies that we need.

11:10.280 --> 11:14.740
And then after that we're going to copy dot dot.

11:14.840 --> 11:17.310
So we are going to copy the current files.

11:17.330 --> 11:22.600
So we're going to copy abduct pre-wire and requirements that text into the system.

11:22.610 --> 11:22.910
Right.

11:22.910 --> 11:27.850
So we're going to copy it into the current working directory and slash user slash or slash app.

11:28.070 --> 11:33.540
So keep in mind that the first part here is what's on your machine right now right.

11:33.550 --> 11:35.360
This is your actual code.

11:35.510 --> 11:39.540
And then on the right hand side it's actually what's going into the machine.

11:39.680 --> 11:41.990
So you're building the machine bit by bit.

11:41.990 --> 11:48.080
So the first thing is you got the operating system working on bias and change the directory to here

11:48.260 --> 11:54.380
to be that working correctly then you're copying a file from your machine to the new machine you're

11:54.380 --> 12:00.080
building then you're running Peppe install on your on the new machine to install these requirements

12:00.080 --> 12:01.190
on the new machine.

12:01.340 --> 12:07.240
And then you're copying all your files your application and the UI onto the new machine.

12:07.300 --> 12:12.790
And so the final thing that we have to do is just to write a command as a command distilling daquiri

12:12.800 --> 12:14.630
to run a command.

12:14.750 --> 12:20.270
And that's basically going to be Python and then Colma and then app duppy away.

12:20.360 --> 12:26.390
So it's telling it to re bison run this command on the new machine python app that way.

12:26.660 --> 12:32.540
So you can think of this docker file over here as we're building a machine with a web application but

12:32.540 --> 12:36.610
we're building it step by step right just like how we did in the start.

12:36.650 --> 12:42.270
The first thing is I taught you how to use the virtual box to download a buntu and Python.

12:42.320 --> 12:44.090
So we had this from year.

12:44.300 --> 12:46.880
And then the next thing we made a new directory right.

12:46.880 --> 12:54.040
We made tutorial one on the desktop and and then we installed some requirements like flask and then.

12:54.080 --> 12:56.780
So this is this one flask and flask restful.

12:57.020 --> 13:00.290
And then we ran that we installed these.

13:00.290 --> 13:08.660
So these two steps here download and install the new flask and flask restful on the system and then

13:08.840 --> 13:16.180
we introduced to up into this virtual box here and then we once we were happy with it we were on Piscean

13:16.210 --> 13:23.150
and up Pusey you can think of this as really a process of building the other system the new the new

13:23.330 --> 13:26.290
computer if you may say from scratch.

13:26.290 --> 13:27.200
Right so that's.

13:27.200 --> 13:32.870
And that gives you a lot of flexibility with what you you want at your environment and what you don't

13:32.870 --> 13:33.720
want in it.

13:33.770 --> 13:41.300
So we say that for now and then for further requirements here we need two things we need a flask.

13:41.770 --> 13:42.290
Right.

13:42.420 --> 13:46.280
Sometimes it gives me problems for the f or f.

13:46.520 --> 13:48.150
So this might throw some years.

13:48.290 --> 13:55.670
And also we are going to with that flask restful or install flasks full rest folk.

13:55.700 --> 14:02.680
So we just add them in two different lines and basically that tells pit install to install flask.

14:02.690 --> 14:04.500
And last question right.

14:04.940 --> 14:06.890
OK so far so good.

14:06.900 --> 14:13.910
Now if we go back to the terminal and then we go so we go one step back and then we do sort of atom

14:13.970 --> 14:16.100
here so we open atom here again.

14:17.880 --> 14:19.170
Now what's happening here.

14:20.150 --> 14:28.130
Now we have two folders we have database which we didn't put anything in and we have again a web a web

14:28.210 --> 14:34.730
all right which has ADD UP WHY WE HAVE A or file the doc or file that explains how to run this whole

14:34.730 --> 14:44.740
system web system or a web module if you may see onto the new machine and then you have amped PUA which

14:44.740 --> 14:50.680
is on the outside right which the one we Capuzzo we don't actually need this one so we can delete it.

14:50.680 --> 14:50.960
Right.

14:50.960 --> 14:52.630
Move into the trash.

14:52.630 --> 15:00.070
Now what we're going to do is we want to have some way to automatically start this web application right

15:00.070 --> 15:00.610
away.

15:00.620 --> 15:04.360
Right so we want some way to be able to run it right away.

15:04.540 --> 15:09.840
So what we're going to do is we're going to be at the top level.

15:09.850 --> 15:17.020
So for here we have D.B in web and then I'm going to make a new file which is called docker and it has

15:17.020 --> 15:22.550
to be exactly this like this Dharker compose that YAML.

15:23.050 --> 15:29.240
OK so Dr. Dash compose dot why and how and it's pronounced YAML.

15:29.590 --> 15:33.940
So I click enter and again pseudo-ID you forgetting that.

15:34.090 --> 15:41.870
And so if we go back to our atom here and see this Adam over here.

15:42.050 --> 15:50.240
And so now we're going to be able to be writing here is a new or compose YAML file that basically contains

15:50.300 --> 15:57.200
all these containers so you can think of it as we have so many images here right web database web to

15:57.230 --> 16:02.960
maybe maybe have two web applications running at the same time and you will one file to control all

16:02.960 --> 16:07.910
of these to control the communication between them to control what ports they're running on to control

16:07.910 --> 16:09.260
everything about them.

16:09.290 --> 16:13.690
And so the first thing is we're going to write a version and then three.

16:13.700 --> 16:14.120
Right.

16:14.210 --> 16:15.910
So we're using version 3.

16:15.920 --> 16:21.650
There are many versions of blogger compose each have different syntax but the latest one is version

16:21.650 --> 16:24.780
3 so we're going to be using version 3.

16:24.830 --> 16:29.480
And then we're going to write services and then enter.

16:29.960 --> 16:32.140
And then the first service is wed.

16:32.180 --> 16:32.500
Right.

16:32.510 --> 16:35.280
We're building the first one which is web.

16:36.080 --> 16:40.490
And then we're going to tell Dr. Campos to build it from.

16:40.490 --> 16:46.980
So I'm going to tell build from this current directory then Web.

16:47.300 --> 16:54.860
So I'm basically telling this what I'm doing here is I'm saying when is a service and you can build

16:54.860 --> 16:58.150
this service so you can build this web.

16:58.240 --> 17:00.050
So let's go from the backwards.

17:00.170 --> 17:07.100
You can build the web service from the they're actually at dot slash web.

17:07.100 --> 17:09.420
So this is where the docker file is.

17:09.410 --> 17:17.060
So at this location you must have a docker file so set so that this doctor compose would know how to

17:17.060 --> 17:18.700
build this module right.

17:18.770 --> 17:24.450
Because the doc or I remember the doc file is what tells the doctor or doc or compose how to build the

17:24.450 --> 17:26.750
entire computer from scratch right.

17:26.820 --> 17:28.990
And so this is basically selling it.

17:29.030 --> 17:33.170
Hey I have a web not you and you can build it from this app from this.

17:33.180 --> 17:34.260
They're actually over here.

17:34.340 --> 17:37.300
So a not so great directory slash web.

17:37.460 --> 17:38.220
OK.

17:38.630 --> 17:43.430
And then I'm also going to tell it I have sports I want to open some boards.

17:43.760 --> 17:50.120
And then the first port is 5000 whoops and that's 5000.

17:50.330 --> 17:53.040
And then I want to match it to 5000.

17:53.330 --> 17:53.870
OK.

17:53.990 --> 17:59.800
So I want I mean if you remember we talked about ports before and it's basically matching five seconds

17:59.810 --> 18:01.930
so I think this should be here.

18:02.070 --> 18:02.500
Yes.

18:02.720 --> 18:04.640
So five thousand to five.

18:06.500 --> 18:07.220
OK.

18:08.380 --> 18:10.840
Now once we're done with that then we're done.

18:10.850 --> 18:13.900
Now let's say we add database which is another one.

18:13.910 --> 18:15.110
So we add data.

18:15.140 --> 18:22.730
So another service would be D.B and then I would say build you can build it from that slash D.B and

18:22.730 --> 18:27.980
then D-B should also have a docker file inside of it that tells you how to build this database from

18:27.980 --> 18:28.980
scratch right.

18:29.030 --> 18:35.540
So you can think hey that this daquiri composed YAML file it might have it you might even have to write

18:35.800 --> 18:42.020
and then this would have build and then you can build it from Web to write as though you can have multiple

18:42.020 --> 18:47.900
services and all of them can communicate with each other very easily using Bocker composer.

18:47.900 --> 18:56.510
That's why Dr. kapos is very simple because instead of just dealing with one docker or container image

18:56.570 --> 19:02.420
at a time you can just communicate with all of them using block or compose so that's super useful.

19:02.750 --> 19:05.350
So for now we don't have anything for a database or web.

19:05.360 --> 19:08.260
Those are we going to delete it and leave it as it does.

19:09.330 --> 19:12.420
Now we're going to save that and that's about it.

19:12.420 --> 19:19.590
If we want to run this system so you just save this and then we're going to go back a year and we're

19:19.590 --> 19:27.290
going to have the first we're going to first ride pseudo darker compose build.

19:27.390 --> 19:30.140
So we want to build the entire system first.

19:32.690 --> 19:33.770
So we have an air

19:39.480 --> 19:43.650
OK so I think the problem here is this this space over here.

19:43.670 --> 19:50.150
So you need to have a space between the command and because when you're you notice when you have it

19:50.150 --> 19:54.390
here you stuck to version and so version wasn't considered right.

19:54.410 --> 19:59.520
So you just have to put a space here and hopefully once you do that then that should hopefully work

19:59.520 --> 19:59.810
great.

19:59.810 --> 20:04.450
There shouldn't be any problems and then you go out and you do soon to build.

20:04.520 --> 20:08.520
And so I was going to tell you that it's building weap right.

20:08.690 --> 20:11.530
So is for us going to pull from by then.

20:11.540 --> 20:12.050
Right.

20:12.140 --> 20:14.640
And it's basically pulling from where.

20:14.660 --> 20:21.290
Well it's pulling from voc rehab like we discussed and so I was going to download it and do it.

20:21.290 --> 20:24.750
So that's step one out of six so I'll come back once this is done.

20:27.230 --> 20:34.010
So you'll notice here that the first step is done and we have downloaded basically by in theory and

20:34.220 --> 20:40.080
the operating system and then they start step two which is to make the work directory as last users

20:40.100 --> 20:45.220
last slash Flash app and then the steps three is to copy the requirements that Daggs.

20:45.220 --> 20:48.580
Step four is as we said to run install.

20:48.590 --> 20:52.460
And so now it's going to be installing flask and flask restful.

20:52.550 --> 20:53.390
OK.

20:53.680 --> 20:55.620
And so now it's downloading.

20:55.790 --> 21:03.060
And if you notice here that we downloaded everything we've copied and now we're running BIOS and amped

21:03.080 --> 21:03.920
up the way.

21:04.100 --> 21:09.830
OK so now that we've done this and we've built the system successfully then now if you want to run this

21:09.830 --> 21:18.960
system then we would go to and write pseudo doctor compose compose and then the last time we rode to

21:19.100 --> 21:20.790
dock or compose build.

21:20.930 --> 21:28.640
But this time round your eyes Sudhakar combos up and so click this and then we write the password to

21:28.650 --> 21:29.730
here.

21:30.200 --> 21:31.010
OK.

21:32.310 --> 21:39.300
And so now you will see what it's doing is it tells you we're creating the network to Turo one default

21:39.470 --> 21:41.650
was that was the default driver.

21:41.730 --> 21:44.630
And it's attaching the instance to it.

21:44.690 --> 21:50.750
And it's saying environment is production and this is where we're going to talk about this later.

21:50.760 --> 21:55.890
But it's basically saying that your server is now running it went to seven point zero point zero point

21:55.890 --> 21:56.940
one.

21:57.090 --> 21:58.810
I found it and so whoops.

21:58.830 --> 22:02.810
So we've accidentally clicked Control-C to close this off.

22:02.810 --> 22:05.160
Close the the server.

22:05.190 --> 22:07.030
But if I rerun it again.

22:07.080 --> 22:08.910
So let's try to rerun it again.

22:09.950 --> 22:13.740
And OK so it's running now and you would notice here that it's running in the site.

22:13.750 --> 22:23.530
So if we go here and we click on the year and then we go control the so we can tell you that the connection

22:23.530 --> 22:24.970
was reset.

22:25.000 --> 22:26.140
So yes.

22:26.500 --> 22:30.970
So OK so I found the error.

22:30.980 --> 22:36.770
So in this year if you remember when were running that application that we need now in this case we

22:36.770 --> 22:42.710
need to specify that the local that the host to run this application should be the local host.

22:42.710 --> 22:43.180
Right.

22:43.310 --> 22:49.130
So we should run this on the local because if you see here in the previous ones we were running on one

22:49.130 --> 22:51.070
to seven point zero point zero point one.

22:51.070 --> 22:54.450
But this is the local host of the machine itself right.

22:54.620 --> 23:01.080
So what we need to do is to to change those so that it's actually an ad.

23:02.140 --> 23:06.270
If you notice here it says it's running on zero point zero point zero point zero.

23:06.380 --> 23:12.540
So the only thing we're going to do differently is to go back and to run the host add host equals zero

23:12.540 --> 23:14.560
point zero point zero point zero.

23:15.110 --> 23:23.220
Now if we open up post man and we go and we try to do some sort operations are you going to do local

23:23.310 --> 23:30.250
host OK 5000 slash ad and then let's change that.

23:30.250 --> 23:34.350
For example to try to maybe zoomin.

23:34.820 --> 23:36.060
Are you seeing this.

23:36.280 --> 23:41.570
OK so so let's try to make X as for right.

23:41.780 --> 23:43.170
And why is 5.

23:43.190 --> 23:46.010
And then we want it whoops we want to save that.

23:46.340 --> 23:52.280
And so we can send this this information and then we should get their response back.

23:52.280 --> 23:58.240
So if we go here and we see the bodies let's see how we can make it even smaller now.

23:58.370 --> 24:01.570
So the result is status code is 200.

24:01.790 --> 24:05.060
And the message is nine so four plus five is nine.

24:05.360 --> 24:11.500
So if you do that instead as divide right or it was it division I think.

24:11.840 --> 24:20.260
So we closed that and we said and then we get a 200 0.8 so for divided by five is your appointed.

24:20.600 --> 24:21.840
So you get the idea.

24:21.840 --> 24:29.390
So basically what we've done here is we've reduced the system to one dog or file which is controlling

24:29.570 --> 24:31.380
all of the containers.

24:31.520 --> 24:40.340
And then this container here contains only one web application and IPY and this adds up to why is running

24:40.340 --> 24:45.200
inside a container that is specified by this Dharker file over here.

24:45.260 --> 24:46.860
So this Dharker file is.

24:46.910 --> 24:53.990
You can think of it as a separate computer or a separate server and it running in a buntu machine with

24:53.990 --> 25:01.990
Python and it has all the requirements flask and flask restful and it's running at the Y at all times.

25:02.120 --> 25:04.070
And so it's trying the web server.

25:04.280 --> 25:06.260
And this is a requirement that text.

25:06.410 --> 25:10.080
And so now we have a system where what if we want to do it.

25:10.110 --> 25:17.090
So let's say for example I want I come here and I want to do is change yours or let's say I want to

25:17.090 --> 25:21.180
do this is message one right or do something so I can say that.

25:21.320 --> 25:25.670
And then once on I want to test my code I just Control-C eat.

25:25.670 --> 25:34.040
So I stalk my daughter compose and then I rerun Sudhakar compose up race only you don't need to do to

25:34.040 --> 25:39.980
do a rebuild unless you change something in the file address and you add a new file or you change one

25:39.980 --> 25:42.930
of the darker files then you need to run build again.

25:43.040 --> 25:45.050
But if you only if you don't need to.

25:45.050 --> 25:50.620
You can just do Sudhakar combos up and so it runs your server right away.

25:50.630 --> 25:57.920
So this is very very very quickly in that we can you know work do our code here do our changes and then

25:57.920 --> 26:04.130
just run the server and voila all the systems are running all the databases everything is running and

26:04.130 --> 26:05.810
we can test the code right away.

26:05.810 --> 26:07.500
So this is super helpful.

26:07.550 --> 26:14.390
For now it just seems like you know I might hear someone saying Oh we can just use you know Python flask

26:14.390 --> 26:18.670
or or or just from the terminal on say Dyson laptop you why does this.

26:18.670 --> 26:19.430
Answer that.

26:19.550 --> 26:25.480
But later on we're going to add a mongo TB database and we're going to add more stuff.

26:25.480 --> 26:29.190
So you're going to want to have some way to control all these systems.

26:29.300 --> 26:36.160
And the best way to do this is Dr. Campos so you can with only one one command you can raise all the

26:36.400 --> 26:37.390
system up.

26:37.760 --> 26:39.320
So hopefully that makes sense.

26:39.320 --> 26:41.990
We haven't done any Lots of changes.

26:41.990 --> 26:44.650
In fact we only wrote this or file.

26:44.720 --> 26:52.400
Dr. gumbos and we only installed darker and darker compose on the system so nothing too major right.

26:52.400 --> 26:57.270
We've only added like these are the two major files that we've added and we've done some re ordering

26:57.270 --> 26:58.650
in the structure of the code.

26:58.650 --> 27:01.760
Right so it's now D-B weapons stuff like that.

27:02.070 --> 27:02.530
So yeah.

27:02.540 --> 27:05.420
Thanks for watching and I'll see you in the next video.
