Skip to content

Commit 97e9f60

Browse files
authored
Review chapter_09_docker.asciidoc
1 parent a7b7a2a commit 97e9f60

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

chapter_09_docker.asciidoc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,8 @@ What do we need to do? Something like this, right?
557557
We create a new file called _Dockerfile_ in the base folder of our repo,
558558
next to the `src/` directory we made earlier:
559559

560+
// JAN: I'd suggest to use python3.11:slim or python3:12 slim. Keeping image tags too open leads to issues in a couple of months (not always, but waaay too often)
561+
// JAN: I'd use Docker comments with # for <1>, <2>, ... Otherwise, you need to edit the code when you paste it
560562

561563
.Dockerfile (ch09l003)
562564
====
@@ -806,7 +808,7 @@ with `docker ps`:
806808
807809
[role="skipme small-code"]
808810
----
809-
$ *docker ps
811+
$ *docker ps*
810812
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
811813
0818e1b8e9bf superlists "/bin/sh -c 'python …" 4 seconds ago Up 4 seconds hardcore_moore
812814
----
@@ -1237,7 +1239,7 @@ NOTE: If you don't see this error,
12371239
and you should be able to repro the error. I promise it's instructive!
12381240
12391241
1240-
==== Should we run "migrate" inside the Dockerfile? No.
1242+
==== Should we run "migrate" inside the Dockerfile? No. // JAN: Not sure I understand this line. You're saying that we shouldn't run migrate inside our Dockerfile, but then in the next line you do exactly that
12411243
12421244
So, should we include `manage.py migrate` in our Dockerfile?
12431245
@@ -1259,7 +1261,7 @@ CMD python manage.py runserver
12591261
<1> We run `migrate` using the `--noinput` argument to suppress any little "are you sure" prompts.
12601262
12611263
1262-
If we try our FTs again, they all pass!
1264+
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
12631265
12641266
12651267
[role="small-code"]
@@ -1306,6 +1308,8 @@ CMD python manage.py runserver
13061308
----
13071309
====
13081310
1311+
// JAN: I assume you meant to keep CMD python manage.py runserver 0.0.0.0:8888 as is and just remove migrations. Without that, port mapping won't work and server won't listen to external connections
1312+
13091313
Let's start by re-creating the database with `migrate`
13101314
(when we moved everything into `./src`, we left the database file behind):
13111315

0 commit comments

Comments
 (0)