From 5e08f06e3f3af0d9d72a1d422a40f96c89549344 Mon Sep 17 00:00:00 2001 From: Sadiq Khoja Date: Thu, 7 Dec 2023 18:06:11 -0500 Subject: [PATCH] API-docs container: use env variable for spec path (#1039) this fixes issue where git is unable to operate on mounted file --- Makefile | 2 +- odk-docs.dockerfile | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b1ca36002..528ac35bf 100644 --- a/Makefile +++ b/Makefile @@ -105,4 +105,4 @@ check-file-headers: .PHONY: api-docs api-docs: (test "$(docker images -q odk-docs)" || docker build --file odk-docs.dockerfile -t odk-docs .) && \ - docker run --rm -it -v ./docs/api.yaml:/docs/docs/_static/api-spec/central.yaml -p 8000:8000 odk-docs \ No newline at end of file + docker run --rm -it -v ./docs:/docs/docs/_static/central-spec -p 8000:8000 odk-docs \ No newline at end of file diff --git a/odk-docs.dockerfile b/odk-docs.dockerfile index 8a92593e8..d8f0ef30f 100644 --- a/odk-docs.dockerfile +++ b/odk-docs.dockerfile @@ -10,6 +10,8 @@ RUN sed -i 's/sphinx-autobuild.*/& --host 0.0.0.0/' Makefile RUN pip3 install -r requirements.txt +ENV API_SPEC_PATH "/docs/docs/_static/central-spec/api.yaml" + EXPOSE 8000 -ENTRYPOINT ["/bin/sh", "-c" , "(git pull --autostash) && make autobuild"] \ No newline at end of file +ENTRYPOINT ["/bin/sh", "-c" , "(pip3 install -r requirements.txt) && (git pull --autostash) && make autobuild"] \ No newline at end of file