From 25906c7697258848ce0f970bdf08ce04d50d6824 Mon Sep 17 00:00:00 2001 From: Ben Sturmfels Date: Fri, 2 Feb 2024 13:38:27 +1100 Subject: [PATCH] Improve Docker docs --- Dockerfile-debian-bookworm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Dockerfile-debian-bookworm b/Dockerfile-debian-bookworm index d68c174d..446a27f0 100644 --- a/Dockerfile-debian-bookworm +++ b/Dockerfile-debian-bookworm @@ -2,12 +2,22 @@ # docker build --tag sfconservancy.org-bookworm --file Dockerfile-debian-bookworm . # # To run the website, first ensure you have a -# "conservancy/djangocommonsettings.py" file, with an appropriate database path. Then run: +# "conservancy/djangocommonsettings.py" file, with an appropriate database path. # -# run --tty --interactive --rm=true --publish=8000:8000 \ +# [FIRST RUN ONLY] If you don't have an existing copy of the database, run: +# touch conservancy-website.sqlite3 +# +# Start the application with: +# docker run --tty --interactive --rm=true --publish=8000:8000 \ # --mount type=bind,source=$(pwd),target=/var/www/website \ # --mount type=bind,source=$(pwd)/conservancy-website.sqlite3,target=/var/lib/www/database/conservancy-website.sqlite3 \ # sfconservancy.org-bookworm:latest +# +# [FIRST RUN ONLY] In a separate terminal, run `docker ps` noting "CONTAINER ID". +# Then run the database migrations with: +# docker exec -it [CONTAINER ID] /usr/bin/python3 manage.py migrate +# +# Visit the site at http://127.0.0.1:8000 ARG DEBIAN_FRONTEND=noninteractive