-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
281 lines (227 loc) · 8.8 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
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html">
<head>
<meta charset="utf-8"/>
<title>How to put an elephant in a container</title>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"/>
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/>
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/>
<link rel="manifest" href="/site.webmanifest"/>
<meta name="description" content="Development in PHP with Docker"/>
<meta name="author" content="Damien Carcel"/>
<meta name="apple-mobile-web-app-capable" content="yes"/>
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
<meta
name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no, minimal-ui"
/>
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<h2>How to put an elephant<br>in a container</h2>
<p>-</p>
<h3>Developing in PHP with Docker</h3>
</section>
<section id="intro">
<section>
<h2 class="top-slide-header">About me</h2>
<div class="centered-slide-content two-columns-slide">
<div class="col"><img alt="pingoo" src="images/pingoo.png" height="300px">
<br>
<b>Damien Carcel</b>
<br>
<i>Software Lead at Akeneo</i>
</div>
<div class="col">
<br>
<br>
<div><img class="vertical-align" alt="github" src="images/github-logo.png" height="50px"> <a class="vertical-align" href="https://github.com/damien-carcel">damien-carcel</a></div>
<div><img class="vertical-align" alt="twitter" src="images/twitter-logo.png" height="50px"> <a class="vertical-align" href="https://twitter.com/damiencarcel">@damiencarcel</a></div>
<div><img class="vertical-align" alt="linkedin" src="images/linkedin-logo.png" height="50px"> <a class="vertical-align" href="https://www.linkedin.com/in/damien-carcel/">damien-carcel</a></div>
</div>
</div>
<aside class="notes">
Say a few words about Akeneo and the PIM.
</aside>
</section>
<section>
<h2 class="title">The problem</h2>
<div class="centered-slide-content">
<div>Working on Akeneo PIM in 2015 as a support engineer:</div>
<br>
<div><span class="fragment">Symfony 2 on a LAMP stack.</span><span class="fragment"> But...</span></div>
<br>
<ul>
<li class="fragment">PHP 5.3 to 5.6</li>
<li class="fragment">MySQL 5.5 or 5.6</li>
<li class="fragment">Optionally MongoDB (2.2 or 2.4) and Elasticsearch</li>
<li class="fragment">Apache (2.2 or 2.4) with mod_php</li>
</ul>
</div>
<aside class="notes"></aside>
</section>
<section>
<h2 class="title">The problem</h2>
<div class="centered-slide-content">
<div>Then came Akeneo PIM 2</div>
<ul>
<li class="fragment">PHP 7.*</li>
<li class="fragment">MySQL 5.7</li>
<li class="fragment">Elasticsearch 5.*</li>
<li class="fragment">Apache with PHP FPM</li>
</ul>
</div>
<aside class="notes">
2017
</aside>
</section>
<section>
<h2 class="title">The solution</h2>
<div class="centered-slide-content">
<div class="fragment" style="font-size: 200%"><b>Docker!</b></div>
<br>
<div class="fragment" style="font-size: 80%">(We tried some other stuff before it: Vagrant, LXC…)</div>
</div>
<aside class="notes"></aside>
</section>
</section>
<section id="docker">
<section>
<h2 class="title">What is Docker</h2>
<div class="centered-slide-content">
<img alt="docker" src="images/docker.png">
</div>
<aside class="notes"></aside>
</section>
<section>
<h2 class="title">Docker is not a VM</h2>
<div class="centered-slide-content">
<img alt="vms_vs_containers" src="images/vms_vs_containers.jpg">
</div>
<aside class="notes">
We used Vagrant as a front-end for Virtual Box.
Slow, especially when you share files between the VM and the host.
Docker has native performances.
Compared to LXC, Docker is lighter: only one process, not a whole system.
</aside>
</section>
<section>
<h2 class="title">Docker images</h2>
<div class="centered-slide-content">
<br>
<br>
<img alt="hub" src="images/hub.png">
</div>
<aside class="notes">
A lot of "official" (made by Docker teams) images are on the Docker Hub.
Other registries exist, and can be private.
You can choose the version you want.
</aside>
</section>
</section>
<section id="demo">
<section>
<h2 class="title">Let's build</h2>
<div class="centered-slide-content">
<br>
<br>
<img alt="cat" src="images/cat.png">
</div>
<aside class="notes">
Create and run a Symfony app through Docker.
</aside>
</section>
<section>
<h2 class="title">Let's go further with our own image</h2>
<div class="centered-slide-content">
<pre style="font-size: large"><code class="dockerfile">
FROM debian:bullseye-slim
ARG DEBIAN_FRONTEND=noninteractive
ENV XDEBUG_ENABLED=0
RUN apt-get update && \
apt-get --yes install apt-transport-https ca-certificates gpg gpg-agent wget && \
echo 'deb https://packages.sury.org/php/ bullseye main' > /etc/apt/sources.list.d/sury.list && \
wget -O sury.gpg https://packages.sury.org/php/apt.gpg && apt-key add sury.gpg && rm sury.gpg && \
apt-get update && \
apt-get --yes install php8.2-apcu php8.2-cli php8.2-curl php8.2-intl \
php8.2-opcache php8.2-xdebug php8.2-xml php8.2-zip unzip
COPY docker/app.ini /etc/php/8.2/cli/conf.d/99-app.ini
COPY docker/xdebug.ini /etc/php/8.2/cli/conf.d/99-app-xdebug.ini
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer
RUN chmod +x /usr/local/bin/composer
</code></pre>
</div>
<aside class="notes">
Create a dedicated Dockerfile and build it as an image.
</aside>
</section>
<section>
<h2 class="title">Docker Compose for the win</h2>
<div class="centered-slide-content">
<br>
<br>
<img alt="compose" src="images/compose.png">
</div>
<aside class="notes">
Let's build AND run the image with Docker Compose
</aside>
</section>
</section>
<section id="conclusion">
<section>
<h2 class="title">A few tips to finish</h2>
<div class="centered-slide-content">
<div class="fragment">Like you update your system, pull images regularly</div>
<br>
<ul>
<li class="fragment">docker (compose) pull</li>
<li class="fragment">docker (compose) build --pull</li>
</ul>
</div>
<aside class="notes"></aside>
</section>
<section>
<h2 class="title">A few tips to finish</h2>
<div class="centered-slide-content">
<div>Accessing your logs is easy</div>
<br>
<ul>
<li class="fragment">docker (compose) logs <container/service></li>
<li class="fragment">docker (compose) logs -f <container/service></li>
<li class="fragment">docker (compose) logs --tail x <container/service></li>
</ul>
</div>
<aside class="notes"></aside>
</section>
<section>
<h2 class="title">A few tips to finish</h2>
<div class="centered-slide-content">
<div>Don't forget to clean up</div>
<br>
<ul>
<li class="fragment">docker container/image/network/volume prune</li>
<li class="fragment">docker system prune --volumes</li>
<li class="fragment">docker system prune --all</li>
</ul>
</div>
<aside class="notes"></aside>
</section>
<section>
<h2 class="title">Explore</h2>
<div class="centered-slide-content r-stack">
<img alt="docker-output" src="images/docker-output.png">
<img alt="image-output" class="fragment" src="images/image-output.png">
</div>
<aside class="notes"></aside>
</section>
<section>
<div class="centered-slide-content thank-you">Thank you</div>
</section>
</section>
</div>
</div>
<script type="module" src="/main.js"></script>
</body>
</html>