Skip to content

Commit b125f78

Browse files
committed
add notice on db built into image
add suggestion to put db.sqlite3 into the .dockerfile
1 parent 93efbc8 commit b125f78

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

chapter_09_docker.asciidoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1282,6 +1282,9 @@ OK
12821282
12831283
But we don't actually want to package up our database _inside_ the image, do we?
12841284
We want the database on the server to have totally separate data from the one on our machine.
1285+
// CSANAD: we need to list `src/db.sqlite3` in the .dockerignore file to achieve this.
1286+
// Otherwise, if the reader did not delete the DB, it would still end up built into
1287+
// the image since the COPY directive copies everything that's inside `src`.
12851288
12861289
In most deployments, you'd probably be talking to a separate database server, like postgres.
12871290

chapter_11_ansible.asciidoc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -956,22 +956,22 @@ That gets us to
956956
selenium.common.exceptions.NoSuchElementException: Message: Unable to locate
957957
element: [id="id_list_table"]; [...]
958958
----
959-
// CSANAD: I have a different error:
960-
// AssertionError: 'To-Do' not found in 'Bad Request(400)'
961-
//
962-
// >>> from django.conf import settings
963-
// >>>
964-
// >>>
965-
// >>> settings.ALLOWED_HOSTS
966-
// ['"192.168.122.23"']
967-
// >>>
968-
//
969959

970960

971961
=== Mounting the database on the server and running migrations
972962

973963
Taking a look at the logs from the server,
974964
we can see that the database is not initialised.
965+
// CSANAD: this is not the case for me. I had to ssh into the server, run bash
966+
// in the container and remove the `db.sqlite3` manually to achieve this state.
967+
//
968+
// After checking the work again from Chapter 09 I think the reader would also find the db
969+
// there before the next step.
970+
//
971+
// We should put the db into a .dockerignore file so that it doesn't end up COPY -ed.
972+
//
973+
// I'm adding a comment to Chapter 09, "Mounting files inside the container" section.
974+
975975

976976
[subs="specialcharacters,quotes"]
977977
----

0 commit comments

Comments
 (0)