Skip to content

Commit 9457485

Browse files
committed
Merge remote-tracking branch 'csanad/review--chapter-09-rev2'
2 parents ad5a90a + 8a84c53 commit 9457485

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

chapter_09_docker.asciidoc

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,10 @@ TIP: I'm deliberately choosing a different port to run Dockerised Django on (888
406406

407407
I'll use the `--failfast` option to exit as soon as a single test fails:
408408

409+
// CSANAD: are line breaks necessary below and at other occurrences of
410+
// --failfast? it does keep the asciidoc lines of source below 80
411+
// characters but there are some wider lines elsewhere.
412+
409413
[role="small-code"]
410414
[subs="specialcharacters,macros"]
411415
----
@@ -811,6 +815,16 @@ WARNING: Make sure you use the `-it` flags to the Docker `run`
811815
*******************************************************************************
812816
If you've got a container that's "hanging" in a terminal window,
813817
you can kill it from another one.
818+
// CSANAD: `docker stop` would trigger a graceful SIGTERM, `docker kill` sends a SIGKILL.
819+
// SIGKILL would terminate the container even when SIGTERM cannot, but it could
820+
// also result in broken DB, leave the port "in use" or other side effects. I would prefer
821+
// using `docker stop` over `kill` and mention `kill` in case the container is still stuck.
822+
//
823+
// However, if we leave it with just `docker kill`, then maybe we should mention these
824+
// possible side effects and also the title should reflect it like:
825+
// "How to Forcefully Stop a Docker Container" (since "How to Kill a Container" may sound a bit
826+
// harsh...
827+
814828
815829
The docker daemon lets you list all the currently running containers
816830
with `docker ps`:
@@ -1271,7 +1285,7 @@ CMD python manage.py runserver 0.0.0.0:8888
12711285
<1> We run `migrate` using the `--noinput` argument to suppress any little "are you sure" prompts.
12721286
12731287
1274-
If we try our FTs again, they all pass! // JAN: That's not true. One needs to rebuild the Docker image and start a new container
1288+
If we rebuild the image and try our FTs again, they all pass!
12751289
12761290
12771291
[role="small-code"]
@@ -1406,7 +1420,7 @@ https://en.wikipedia.org/wiki/Digestive_biscuit[chocolate biscuit].
14061420
.Test-Driving Server Configuration and Deployment
14071421
*******************************************************************************
14081422
1409-
Tests and small steps some of the uncertainty out of deployment::
1423+
Tests and small steps take some of the uncertainty out of deployment::
14101424
For developers, ops and infra work is always "fun",
14111425
by which I mean a process full of fear, uncertainty and surprises.
14121426
My aim during this chapter was to show that a step-by-step approach

chapter_10_production_readiness.asciidoc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -365,6 +365,15 @@ TIP: Forgetting the `-r` and running `pip install requirements.txt`
365365
(which is thankfully much more helpful than it used to be).
366366
It's a mistake I still make, _all the time_.
367367

368+
369+
// CSANAD: It's fine for now, but I would definitely put the requirements under
370+
// /tmp and then `rm` it after `pip install`. Also, using a non-privileged
371+
// user is important, something like:
372+
// `adduser --no-create-home --disabled-password todoapp`
373+
// and then setting the user in the Dockerfile with `USER todoapp`.
374+
// But we can cover this in a later chapter (the next one looks like a good fit,
375+
// since it's related to the app being production ready).
376+
368377
Let's do a build & run & test to check everything still works:
369378

370379
[subs="specialcharacters,quotes"]

0 commit comments

Comments
 (0)