This repository has been archived by the owner on Oct 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
763 lines (636 loc) · 21.6 KB
/
index.html
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
<!DOCTYPE html>
<html lang="ru">
<head>
<!-- Google Tag Manager -->
<script>
(function (w, d, s, l, i) {
w[l] = w[l] || [];
w[l].push({ "gtm.start": new Date().getTime(), event: "gtm.js" });
var f = d.getElementsByTagName(s)[0],
j = d.createElement(s),
dl = l != "dataLayer" ? "&l=" + l : "";
j.async = true;
j.src = "https://www.googletagmanager.com/gtm.js?id=" + i + dl;
f.parentNode.insertBefore(j, f);
})(window, document, "script", "dataLayer", "GTM-P6SW86D");
</script>
<!-- End Google Tag Manager -->
<title>Docker для фронтендера</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<!-- prettier-ignore -->
<link rel="stylesheet" href="node_modules/@shower/ribbon/styles/styles.css">
<style>
.shower {
--slide-ratio: calc(16 / 9);
--ribbon-size: 40px;
}
.progress::before {
background-color: #fa1100;
}
.slide {
padding-top: 51px;
background: #fff url(pictures/fcconf_bg.png) no-repeat;
background-size: cover;
}
.slide.clear {
background-image: none;
}
.slide::after {
top: auto;
bottom: 0;
left: 40px;
right: auto;
color: initial;
background: none;
}
</style>
</head>
<body class="shower list">
<!-- Google Tag Manager (noscript) -->
<noscript
><iframe
src="https://www.googletagmanager.com/ns.html?id=GTM-P6SW86D"
height="0"
width="0"
style="display: none; visibility: hidden"
></iframe
></noscript>
<!-- End Google Tag Manager (noscript) -->
<header class="caption">
<h1>Docker для фронтендера</h1>
<p>
<a href="https://alexey-avdeev.com/">Алексей Авдеев</a>,
<a href="https://neuron.digital/">Neuron.Digital</a>
</p>
</header>
<section class="slide clear" id="cover">
<h2>Docker для фронтендера</h2>
<p>
<a href="https://alexey-avdeev.com/">Алексей Авдеев</a>,
<a href="https://neuron.digital/">Neuron.Digital</a>
</p>
<figure>
<img class="cover h" src="pictures/fcconf_title.png" alt="FrontendConf Background" />
</figure>
<style>
#cover h2 {
margin: 0;
color: #000;
font-size: 60px;
}
#cover p {
margin: 10px 0 0;
color: #000;
font-size: 30px;
}
#cover p a {
color: #000;
}
</style>
</section>
<!-- докер приходит во фронтенд -->
<section class="slide">
<img
class="cover w"
src="pictures/trends.png"
alt=""
style="box-shadow: 5px 5px 20px 8px #b9b9b9; width: 80%"
/>
</section>
<section class="slide clear">
<img class="cover w" src="pictures/docker-boat.jpg" alt="" />
</section>
<section class="slide">
<img class="cover w" src="pictures/intro.png" alt="" style="width: 90%" />
</section>
<section class="slide">
<h2 class="shout">Требования: Docker</h2>
</section>
<section class="slide">
<h2 class="shout">Эра Docker</h2>
</section>
<section class="slide">
<h2>👨💻 О себе</h2>
<ol>
<li>
👨 Алексей Авдеев (<a href="https://github.com/avdeev">https://github.com/avdeev</a>)
</li>
<li class="next">👔 Руковожу командой фронтенд-разработчиков</li>
<li class="next">🏙️ Из Нижнего Новгорода, работаю в Москве</li>
<li class="next">🌐 <a href="https://neuron.digital/">Neuron.Digital</a></li>
<li class="next">👴 Программирую с 2002 года</li>
</ol>
</section>
<!-- зачем фронту докер -->
<!-- 1. поднимает локально backend -->
<section class="slide">
<h2 class="shout">Зачем?</h2>
</section>
<section class="slide">
<h2 class="shout">Поднимаем backend</h2>
</section>
<section class="slide clear" style="background-color: #ea413c">
<img class="cover h" src="pictures/iamdone.png" alt="" />
</section>
<section class="slide">
<h2>😫 Без Docker</h2>
<pre>
<code class="next">$ brew update</code>
<code class="next">$ brew install mysql</code>
<code class="next">...</code>
<code class="next">$ \curl -sSL https://get.rvm.io | bash</code>
<code class="next">...</code>
<code class="next">$ rails s</code>
</pre>
</section>
<section class="slide clear">
<img class="cover h" src="pictures/life-stack.png" alt="" style="height: 80%" />
</section>
<section class="slide clear">
<img class="cover w" src="pictures/start-life.png" alt="" />
</section>
<section class="slide clear">
<img class="cover w" src="pictures/life-services.png" alt="" />
</section>
<section class="slide">
<h2>👍 С Docker</h2>
<pre>
<code>$ docker-compose up api</code>
<code>...</code>
<code>Listening localhost:8080</code>
</pre>
</section>
<section class="slide">
<h2>👍 С Docker</h2>
<img class="cover w" src="pictures/compose.png" alt="" style="width: 90%" />
</section>
<section class="slide">
<h2 class="shout">Автоматизируй</h2>
</section>
<!-- 2. оставляем рабочий компьютер чистым -->
<section class="slide">
<h2 class="shout">Устойчивость ⚖</h2>
</section>
<section class="slide clear">
<img class="cover h" style="height: 100%" src="pictures/winXPwin7_1527919170.jpg" alt="" />
</section>
<section class="slide clear">
<img class="cover w" src="pictures/garold.jpg" alt="" />
</section>
<section class="slide">
<h2>👍 С Docker</h2>
<pre>
<code>$ docker rm --volumes api</code>
</pre>
<pre class="next">
<code>$ docker system prune --all</code>
</pre>
</section>
<!-- 3. пишем код для продакшена -->
<section class="slide">
<h2 class="shout">Контролируем эксплуатацию</h2>
</section>
<section class="slide">
<img class="cover h" src="pictures/sa-character-img.png" alt="" style="height: 90%" />
</section>
<section class="slide">
<h2>😫 Без Docker</h2>
<ol>
<li class="next"><mark>nvm use 10</mark></li>
<li class="next"><mark>npm install</mark></li>
<li class="next"><mark>npm run build</mark></li>
<li class="next">Раздаём папку <mark>/dist</mark> веб-сервером</li>
</ol>
</section>
<section class="slide">
<h2>👍 С Docker</h2>
<h2 class="shout">Упаковано в Docker 📦</h2>
</section>
<section class="slide">
<img class="cover w" src="pictures/gitlab.png" alt="" />
</section>
<section class="slide">
<img class="cover h" src="pictures/Geek-T-Shirt.jpg_q50.webp" alt="" />
</section>
<section class="slide">
<img
src="pictures/horizontal-logo-monochromatic-white.png"
alt=""
style="width: 600px; margin: 0 auto; display: block"
/>
<h2 class="shout" style="font-size: 3.1em; margin-top: 80px">
KEEP CALM<br />
IT WORKS<br />
ON ALL MACHINES
</h2>
</section>
<section class="slide">
<h2 class="shout">Пишите код для продакшна</h2>
</section>
<section class="slide clear">
<img class="cover h" src="pictures/what-are-you.jpg" alt="" />
</section>
<section class="slide">
<img class="cover h" src="pictures/doka.jpg" alt="" style="height: 80%" />
</section>
<section class="slide clear">
<img class="cover h" src="pictures/container-on-machine.jpg" alt="" />
</section>
<section class="slide">
<h2 class="shout" style="font-size: 3.6em">
Безопасно собирайте, делитесь и запускайте любое приложение где угодно
</h2>
</section>
<section class="slide clear" style="background-color: #254356">
<img class="cover" src="pictures/[email protected]" alt="" />
</section>
<section class="slide clear" style="background-color: #254356">
<img class="cover" src="pictures/[email protected]" alt="" />
</section>
<section class="slide">
<h2 class="shout">
Установка<br />
Docker ⏬
</h2>
</section>
<section class="slide clear" style="background-color: #061f2f">
<img class="cover w" src="pictures/requirements.png" alt="" />
</section>
<section class="slide clear">
<img class="cover w" src="pictures/docker-app-drag.png" alt="" />
</section>
<section class="slide">
<h2>♻ Установка Docker через Homebrew</h2>
<pre>
<code>$ brew cask install <mark>docker</mark></code>
</pre>
</section>
<section class="slide">
<h2>Что входит в Docker Desktop</h2>
<ul>
<li class="next">Docker Engine</li>
<li class="next">Docker CLI client</li>
<li class="next">Docker Compose</li>
<li class="next">Docker Machine</li>
<li class="next">Kitematic</li>
</ul>
</section>
<!-- похоже на наши инструменты -->
<section class="slide">
<h2 class="shout">
Docker — это не только для<br />
админов
</h2>
</section>
<section class="slide">
<h2>Что-то для админов</h2>
<ul style="font-size: 1.3em">
<li class="next">docker run</li>
<li class="next">docker build</li>
<li class="next">Dockerfile</li>
<li class="next">Image</li>
<li class="next">DockerHub</li>
</ul>
</section>
<section class="slide">
<h2 class="shout">
Docker как NPM,<br />
но для Ops
</h2>
</section>
<section class="slide">
<h2>Знакомые понятия</h2>
<ul style="font-size: 1.3em">
<li class="next">docker run <b class="next">🔀 npm start</b></li>
<li class="next">docker build <b class="next">🔀 npm run build</b></li>
<li class="next">Dockerfile <b class="next">🔀 package.json</b></li>
<li class="next">Image <b class="next">🔀 Package</b></li>
<li class="next">DockerHub <b class="next">🔀 NPM Registry</b></li>
</ul>
</section>
<section class="slide">
<h2>Знакомые понятия</h2>
<ul style="font-size: 1.3em">
<li class="next">Проект начат как проприетарная разработка</li>
<li class="next">Используется для всего подряд</li>
<li class="next">Есть альтернативы, призванные заменить</li>
</ul>
</section>
<section class="slide">
<img class="cover" src="pictures/dockerhub.png" alt="" />
</section>
<section class="slide">
<img
class="cover w"
src="pictures/dockerhub-registry.png"
alt=""
style="box-shadow: 5px 5px 20px 8px #b9b9b9; width: 90%"
/>
</section>
<section class="slide">
<img
class="cover w"
src="pictures/dockerhub-ubuntu.png"
alt=""
style="box-shadow: 5px 5px 20px 8px #b9b9b9; width: 90%"
/>
</section>
<section class="slide">
<h2>Hello World (1)</h2>
<pre>
<code>$ docker run ubuntu:14.04 /bin/echo 'Hello world'</code>
<code> </code>
<code>Hello world</code>
</pre>
</section>
<section class="slide">
<img
class="cover w"
src="pictures/dockerhub-hello-world.png"
alt=""
style="box-shadow: 5px 5px 20px 8px #b9b9b9; width: 90%"
/>
</section>
<section class="slide">
<h2>Hello World (2)</h2>
<pre>
<code>$ <mark>docker run hello-world</mark></code>
<code></code>
<code>Unable to find image 'hello-world:latest' locally</code>
<code>latest: Pulling from library/hello-world</code>
<code>...</code>
<code>Hello from Docker!</code>
<code>This message shows that your installation appears...</code>
<code>...</code>
</pre>
</section>
<section class="slide">
<img class="cover" src="pictures/kitematic.png" alt="" />
</section>
<section class="slide">
<h2 class="shout">
Немного<br />
рецептов
</h2>
</section>
<section class="slide">
<img
class="cover w"
src="pictures/dockerhub-sentry.png"
alt=""
style="box-shadow: 5px 5px 20px 8px #b9b9b9; width: 90%"
/>
</section>
<section class="slide">
<img
class="cover w"
src="pictures/dockerhub-sonarqube.png"
alt=""
style="box-shadow: 5px 5px 20px 8px #b9b9b9; width: 90%"
/>
</section>
<section class="slide">
<img
class="cover w"
src="pictures/dockerhub-wordpress.png"
alt=""
style="box-shadow: 5px 5px 20px 8px #b9b9b9; width: 90%"
/>
</section>
<section class="slide">
<img
class="cover w"
src="pictures/dockerhub-minecraft.png"
alt=""
style="box-shadow: 5px 5px 20px 8px #b9b9b9; width: 90%"
/>
</section>
<section class="slide">
<img
class="cover w"
src="pictures/dockerhub-docker.png"
alt=""
style="box-shadow: 5px 5px 20px 8px #b9b9b9; width: 90%"
/>
</section>
<section class="slide">
<h2 class="shout">Запускаем Lighthouse</h2>
</section>
<section class="slide">
<h2>😫 Без Docker</h2>
<pre>
<code class="next">Установить Google Chrome for Desktop.</code>
<code class="next">Установить текущую LTS-версию Node.</code>
<code class="next">$ npm install -g lighthouse</code>
<code class="next">$ lighthouse http://frontendconf.ru</code>
</pre>
</section>
<section class="slide">
<img
class="cover w"
src="pictures/dockerhub-google-lighthouse.png"
alt=""
style="box-shadow: 5px 5px 20px 8px #b9b9b9; width: 90%"
/>
</section>
<section class="slide">
<h2>👍 С Docker</h2>
<pre>
<code>$ docker run \</code>
<code> --rm \</code>
<code> --name lighthouse \</code>
<code> -it \</code>
<code> --volume ~:/home/chrome/reports \</code>
<code> --cap-add=SYS_ADMIN \</code>
<code> <mark>femtopixel/google-lighthouse http://frontendconf.ru</mark></code>
</pre>
</section>
<section class="slide">
<h2 class="shout">Нагрузка</h2>
</section>
<section class="slide">
<h2>👍 С Docker</h2>
<pre>
<code>$ docker service scale frontend=10</code>
<code> </code>
<code>frontend scaled to 10</code>
</pre>
</section>
<section class="slide">
<h2 class="shout">Решение организационных вопросов</h2>
</section>
<section class="slide">
<h2>Dockerfile</h2>
<pre>
<code>LABEL maintainer="[email protected]"</code>
</pre>
</section>
<section class="slide">
<h2>docker inspect</h2>
<pre>
<code>$ docker inspect NAME|ID</code>
</pre>
<pre class="next">
<code>"Labels": {</code>
<code> "maintainer": "[email protected]"</code>
<code>}</code>
</pre>
</section>
<section class="slide">
<h2 class="shout">
Выбираем<br />
технологию
</h2>
</section>
<section class="slide clear">
<img class="cover w" src="pictures/frameworks.png" alt="" />
</section>
<section class="slide">
<img
class="cover w"
src="pictures/dockerhub-node.png"
alt=""
style="box-shadow: 5px 5px 20px 8px #b9b9b9; width: 90%"
/>
</section>
<section class="slide">
<h2>Dockerfile (1)</h2>
<pre>
<code>FROM node:10-alpine as builder</code>
<code class="next">WORKDIR /app</code>
<code class="next">COPY package*.json ./</code>
<code class="next">RUN npm ci</code>
<code class="next">COPY vue.config.js babel.config.js ./</code>
<code class="next">COPY src src</code>
<code class="next"><mark>RUN npm run build</mark></code>
</pre>
</section>
<section class="slide">
<img
class="cover w"
src="pictures/dockerhub-nginx.png"
alt=""
style="box-shadow: 5px 5px 20px 8px #b9b9b9; width: 90%"
/>
</section>
<section class="slide">
<h2>Dockerfile (2)</h2>
<pre>
<code>FROM nginx:1.13-alpine</code>
<code class="next">COPY nginx /etc/nginx/conf.d</code>
<code class="next">COPY --from=builder /app/dist/ /usr/share/nginx/html/</code>
<code class="next"><mark>EXPOSE 5000</mark></code>
</pre>
</section>
<section class="slide">
<h2>Запускаем контейнер</h2>
<pre>
<code>docker build <mark>--tag my-app</mark> .</code>
<code class="next">docker run -p 5000:5000 <mark>--tag my-app</mark></code>
</pre>
</section>
<section class="slide">
<h2 class="shout">Демо</h2>
</section>
<section class="slide clear">
<img class="cover h" style="height: 90%" src="pictures/backend-frameworks.png" alt="" />
</section>
<section class="slide">
<img
class="cover w"
src="pictures/dockerhub-node.png"
alt=""
style="box-shadow: 5px 5px 20px 8px #b9b9b9; width: 90%"
/>
</section>
<section class="slide">
<h2>Dockerfile для Node.js</h2>
<pre>
<code>FROM node:10-alpine</code>
<code class="next">WORKDIR /app</code>
<code class="next">COPY package*.json ./</code>
<code class="next">RUN npm ci</code>
<code class="next">COPY . .</code>
<code class="next"><mark>EXPOSE 5000</mark></code>
<code class="next">CMD ["node", "server.js"]</code>
</pre>
</section>
<section class="slide">
<img
class="cover w"
src="pictures/dockerhub-python.png"
alt=""
style="box-shadow: 5px 5px 20px 8px #b9b9b9; width: 90%"
/>
</section>
<section class="slide">
<h2>Dockerfile для Python</h2>
<pre>
<code>FROM python:3-alpine</code>
<code class="next">WORKDIR /usr/src/app</code>
<code class="next">COPY requirements.txt ./</code>
<code class="next">RUN pip install --no-cache-dir -r requirements.txt</code>
<code class="next">COPY . .</code>
<code class="next"><mark>EXPOSE 5000</mark></code>
<code class="next">CMD ["python", "./your-daemon-or-script.py"]</code>
</pre>
</section>
<section class="slide">
<h2 class="shout">Демо</h2>
</section>
<section class="slide">
<h2 class="shout">Универсальная абстракция</h2>
</section>
<section class="slide">
<h2 class="shout">Компонуемость</h2>
</section>
<section class="slide">
<h2>👍 С Docker (docker-compose.yml)</h2>
<pre style="font-size: 0.65em">
<code>services:</code>
<code> <mark>api</mark>:</code>
<code> build: ./api</code>
<code> <mark>front</mark>:</code>
<code> build: ./front</code>
<code> <mark>reverse-proxy</mark>:</code>
<code> image: abiosoft/caddy</code>
<code> ports:</code>
<code> - 80:80</code>
<code> volumes:</code>
<code> - ./Caddyfile:/etc/Caddyfile</code>
</pre>
</section>
<section class="slide">
<h2>Запускаем связку контейнеров</h2>
<pre>
<code>$ docker-compose up</code>
</pre>
</section>
<section class="slide">
<h2 class="shout">Демо</h2>
</section>
<section class="slide">
<h2 class="shout">Виртуализируй</h2>
</section>
<section class="slide">
<h2>👏 Спасибо!</h2>
<ul>
<li>👨 Алексей Авдеев</li>
<li>🌐 <a href="https://github.com/avdeev">https://github.com/avdeev</a></li>
<li>🌐 <a href="https://neuron.digital/">Neuron.Digital</a></li>
</ul>
<img
src="pictures/iam.jpg"
alt="я"
style="height: 250px; position: absolute; right: 80px; top: 141px"
/>
</section>
<footer class="badge">
<a href="https://github.com/shower/shower">Powered by Shower</a>
</footer>
<div class="progress"></div>
<script src="node_modules/shower-core/shower.min.js"></script>
<!-- Copyright © 3000 Yours Truly, Famous Inc. -->
</body>
</html>