fix: mount answer server directory instead of individual file

Docker bind mount fails when mounting a file that doesn't exist on
the host (creates a directory instead). In CI, the container's
$WORK_DIR path differs from the host path, so the file mount failed.

Changed to mount a single answer-server/ directory containing both
default.toml and answers/ subdirectory. Replaced two TF variables
(answer_files_dir, default_answer_file) with one (answer_server_dir).

Layout: $WORK_DIR/answer-server/default.toml + answers/<mac>.toml

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Clint Branham
2026-03-25 17:12:44 -05:00
parent 9e17036169
commit 6e9361eb7c
3 changed files with 17 additions and 25 deletions
+6 -7
View File
@@ -11,14 +11,13 @@ resource "docker_container" "answer_server" {
network_mode = "host"
# Mount the answer server root directory which contains:
# default.toml — fallback answer file
# answers/ — per-MAC answer files
# The server expects both at ./default.toml and ./answers/ relative to /app
volumes {
host_path = var.answer_files_dir
container_path = "/app/answers"
}
volumes {
host_path = var.default_answer_file
container_path = "/app/default.toml"
host_path = var.answer_server_dir
container_path = "/app"
}
}