You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: chapter_09_docker.asciidoc
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -557,6 +557,8 @@ What do we need to do? Something like this, right?
557
557
We create a new file called _Dockerfile_ in the base folder of our repo,
558
558
next to the `src/` directory we made earlier:
559
559
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
560
562
561
563
.Dockerfile (ch09l003)
562
564
====
@@ -806,7 +808,7 @@ with `docker ps`:
806
808
807
809
[role="skipme small-code"]
808
810
----
809
-
$ *docker ps
811
+
$ *docker ps*
810
812
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
811
813
0818e1b8e9bf superlists "/bin/sh -c 'python …" 4 seconds ago Up 4 seconds hardcore_moore
812
814
----
@@ -1237,7 +1239,7 @@ NOTE: If you don't see this error,
1237
1239
and you should be able to repro the error. I promise it's instructive!
1238
1240
1239
1241
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
1241
1243
1242
1244
So, should we include `manage.py migrate` in our Dockerfile?
// 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
+
1309
1313
Let's start by re-creating the database with `migrate`
1310
1314
(when we moved everything into `./src`, we left the database file behind):
0 commit comments