From 640f1841e6840e99a6fa90c4bd22a8ee48ae21a5 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 27 Oct 2025 21:30:01 +0000 Subject: [PATCH] Refactor docker-compose.yml for improved context and volume mounts; update question_form.html to conditionally include question details --- docker/docker-compose.yml | 24 ++++++++++++++---------- sbas/templates/sbas/question_form.html | 5 ++++- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index ccaa3cf6..ffc16612 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -8,19 +8,23 @@ services: command: ["redis-server", "/usr/local/etc/redis/redis.conf"] web: build: - # Use the rad/ directory as the build context and the Dockerfile inside it. - # This avoids relative path issues with different docker/compose versions and buildx. - context: ./rad - dockerfile: Dockerfile + # Use the repository root as the build context so files like requirements.txt + # (located at the repo root) are available during image build. The Dockerfile + # lives at rad/Dockerfile inside the context. + context: .. + dockerfile: rad/Dockerfile command: python manage.py runserver 0.0.0.0:8000 #command: pip install -r requirements.txt volumes: - # Mount the rad app directory into the container WORKDIR used by the Dockerfile - - ./rad:/usr/src/rad - # Mount host media/static/backups into sensible container paths - - ./backups:/usr/src/rad/backups - - ./media:/usr/src/rad/media - - ./static:/usr/src/rad/static + # Mount the repository root into the container WORKDIR so manage.py and + # requirements.txt are available at build/run time. This mirrors working + # in the project root inside the container for development. + - ../:/usr/src/app + # (Optional) keep explicit mounts for media/static/backups if you need + # to override them separately; otherwise they are covered by the repo mount. + - ../backups:/usr/src/app/backups + - ../media:/usr/src/app/media + - ../static:/usr/src/app/static ports: - 8000:8000 - 3459:3459 diff --git a/sbas/templates/sbas/question_form.html b/sbas/templates/sbas/question_form.html index 85f13ee3..5bbda7ea 100644 --- a/sbas/templates/sbas/question_form.html +++ b/sbas/templates/sbas/question_form.html @@ -16,7 +16,10 @@

Submit Question

- {% include "sbas/question_detail.html#links-partial" %} + {{question}} + {% if question %} + {% include "sbas/question_detail.html#links-partial" %} + {% endif %}