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"]
|
||||
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
|
||||
|
||||
@@ -16,7 +16,10 @@
|
||||
<div>
|
||||
<h2>Submit Question</h2>
|
||||
</div>
|
||||
{% include "sbas/question_detail.html#links-partial" %}
|
||||
{{question}}
|
||||
{% if question %}
|
||||
{% include "sbas/question_detail.html#links-partial" %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<form action="" method="post" enctype="multipart/form-data" id="anatomyquestion-form">
|
||||
|
||||
Reference in New Issue
Block a user