1
00:00:04,250 --> 00:00:10,880
It might happen that even after proper volumes mapping configuration for React application like we did

2
00:00:10,880 --> 00:00:16,670
here in the Docker compose file changes are not reflected in the running application.

3
00:00:16,670 --> 00:00:19,910
And basically now see the text on the button is search.

4
00:00:19,910 --> 00:00:27,830
And I saved changes in this file, but in the web browser I still see search, image, text in order

5
00:00:27,830 --> 00:00:29,210
to fix such behavior.

6
00:00:29,210 --> 00:00:35,150
If you see it on your computer as well, we need to add environment variable for react application inside

7
00:00:35,150 --> 00:00:38,240
of the docker compose Yaml file for that.

8
00:00:38,240 --> 00:00:42,050
Let's add here new key called environment like that.

9
00:00:42,140 --> 00:00:51,530
And here will be environment variable called chaukidar underscore use polling like that and let's set

10
00:00:51,570 --> 00:00:55,520
value of this environment variable to true like that.

11
00:00:56,140 --> 00:01:01,570
Let's now save changes in this Docker compose file and now let's rerun Docker Compose.

12
00:01:01,570 --> 00:01:07,510
And before doing that, let's actually compare our contents of this serdtse file here in our front end

13
00:01:07,510 --> 00:01:08,770
application here.

14
00:01:08,890 --> 00:01:15,120
C text search and let me do the same here in the share shell that is still open.

15
00:01:15,130 --> 00:01:23,440
Let's cut search the JS file and here I see search image text and that means that now file on my computer

16
00:01:23,440 --> 00:01:27,640
was not properly synchronized with file inside of the container.

17
00:01:27,670 --> 00:01:32,260
That's why we need to add this option chowkidaar use polling.

18
00:01:32,290 --> 00:01:37,300
This will actually increase a bit usage of the resources by this particular container.

19
00:01:37,300 --> 00:01:43,690
But if on your computer changes are not synchronized, same as on mine, we need to go ahead with such

20
00:01:43,720 --> 00:01:45,520
environment variable set up.

21
00:01:45,730 --> 00:01:53,320
So let's go out from this shell exit and let's stop all running containers by entering command.

22
00:01:53,320 --> 00:01:56,240
Docker compose down.

23
00:01:58,840 --> 00:02:00,370
Let's bring them up again.

24
00:02:03,620 --> 00:02:10,100
Now both containers are running and let's verify whether some changes will be seen or not after using

25
00:02:10,100 --> 00:02:11,810
this environment variable.

26
00:02:11,990 --> 00:02:15,800
Let's go back to web browser first and let's reload our application.

27
00:02:16,250 --> 00:02:19,740
And after a lot I see search text on this button.

28
00:02:19,760 --> 00:02:21,260
Let's try to change it.

29
00:02:21,290 --> 00:02:26,570
Go to search JS file search, something like that.

30
00:02:26,630 --> 00:02:27,860
Let's save changes.

31
00:02:27,890 --> 00:02:32,240
Go back to web browser and almost instantly see changes here.

32
00:02:32,360 --> 00:02:34,520
Let's change it to something else.

33
00:02:34,550 --> 00:02:35,810
Search, Image.

34
00:02:36,140 --> 00:02:36,770
Save.

35
00:02:36,800 --> 00:02:39,560
Go back and almost instant change.

36
00:02:39,800 --> 00:02:43,070
Let's finally go back to search Text on this button.

37
00:02:43,220 --> 00:02:47,270
Save Go back and change is almost instant.

38
00:02:47,360 --> 00:02:55,070
And now I don't see any files and file inside of the front end folder is almost instantly mirrored to

39
00:02:55,070 --> 00:02:56,060
the container.

40
00:02:56,210 --> 00:03:02,180
That's how Chowkidaar use polling option actually works in action, and in order to enable it, you

41
00:03:02,180 --> 00:03:09,060
need to add environment variable using environment key in the Docker compose file and set value of the

42
00:03:09,060 --> 00:03:16,500
variable Chowkidaar use polling to true also if you need, you could set values for other environment

43
00:03:16,500 --> 00:03:19,470
variables in the same section environment.

44
00:03:19,770 --> 00:03:20,700
Wonderful.

45
00:03:20,700 --> 00:03:21,660
Let's now go ahead.

46
00:03:21,660 --> 00:03:29,580
And next, let's add volumes mapping for API service because there we also need to apply changes after

47
00:03:29,580 --> 00:03:34,950
we make them actually in the folder in our local folder here.

48
00:03:35,160 --> 00:03:37,650
Let's proceed with that after the small pause.

