Refactor docker-compose.yml for improved context and volume mounts; update question_form.html to conditionally include question details
This commit is contained in:
+14
-10
@@ -8,19 +8,23 @@ services:
|
|||||||
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
|
command: ["redis-server", "/usr/local/etc/redis/redis.conf"]
|
||||||
web:
|
web:
|
||||||
build:
|
build:
|
||||||
# Use the rad/ directory as the build context and the Dockerfile inside it.
|
# Use the repository root as the build context so files like requirements.txt
|
||||||
# This avoids relative path issues with different docker/compose versions and buildx.
|
# (located at the repo root) are available during image build. The Dockerfile
|
||||||
context: ./rad
|
# lives at rad/Dockerfile inside the context.
|
||||||
dockerfile: Dockerfile
|
context: ..
|
||||||
|
dockerfile: rad/Dockerfile
|
||||||
command: python manage.py runserver 0.0.0.0:8000
|
command: python manage.py runserver 0.0.0.0:8000
|
||||||
#command: pip install -r requirements.txt
|
#command: pip install -r requirements.txt
|
||||||
volumes:
|
volumes:
|
||||||
# Mount the rad app directory into the container WORKDIR used by the Dockerfile
|
# Mount the repository root into the container WORKDIR so manage.py and
|
||||||
- ./rad:/usr/src/rad
|
# requirements.txt are available at build/run time. This mirrors working
|
||||||
# Mount host media/static/backups into sensible container paths
|
# in the project root inside the container for development.
|
||||||
- ./backups:/usr/src/rad/backups
|
- ../:/usr/src/app
|
||||||
- ./media:/usr/src/rad/media
|
# (Optional) keep explicit mounts for media/static/backups if you need
|
||||||
- ./static:/usr/src/rad/static
|
# 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:
|
ports:
|
||||||
- 8000:8000
|
- 8000:8000
|
||||||
- 3459:3459
|
- 3459:3459
|
||||||
|
|||||||
@@ -16,7 +16,10 @@
|
|||||||
<div>
|
<div>
|
||||||
<h2>Submit Question</h2>
|
<h2>Submit Question</h2>
|
||||||
</div>
|
</div>
|
||||||
{% include "sbas/question_detail.html#links-partial" %}
|
{{question}}
|
||||||
|
{% if question %}
|
||||||
|
{% include "sbas/question_detail.html#links-partial" %}
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<form action="" method="post" enctype="multipart/form-data" id="anatomyquestion-form">
|
<form action="" method="post" enctype="multipart/form-data" id="anatomyquestion-form">
|
||||||
|
|||||||
Reference in New Issue
Block a user