From 894dcdb03643350a4e49d771761ec6056749003a Mon Sep 17 00:00:00 2001 From: Aaron Date: Mon, 25 Sep 2023 10:04:06 -0600 Subject: [PATCH] Adds an editable build of arches templating (#17) * Adds an editable build of arches templating * Update dockerfile and compose --- Dockerfile | 15 +++++++++++---- docker-compose.yml | 12 +++++++++--- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2693ee4..3c6f272 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,13 +14,17 @@ ARG TARGETARCH # Select final stage based on TARGETARCH ARG FROM stage-${TARGETARCH} as final +ARG ARCHES_FOR_SCIENCE_HOST_DIR +ARG ARCHES_CORE_HOST_DIR +ARG ARCHES_TEMPLATING_HOST_DIR + ## Setting default environment variables ENV WEB_ROOT=/web_root ENV APP_ROOT=${WEB_ROOT}/disco # Root project folder ENV ARCHES_ROOT=${WEB_ROOT}/arches ENV AFS_ROOT=${WEB_ROOT}/arches-for-science -ENV WHEELS=/wheels +ENV TEMPLATING_ROOT=${WEB_ROOT}/arches-templating ENV PYTHONUNBUFFERED=1 ENV NODE_MAJOR=18 @@ -66,15 +70,18 @@ RUN rm -rf /root/.cache/pip/* # Install the Arches application # FIXME: ADD from github repository instead? -COPY ./arches ${ARCHES_ROOT} -COPY ./arches-for-science ${AFS_ROOT} - +COPY ${ARCHES_CORE_HOST_DIR} ${ARCHES_ROOT} +COPY ${ARCHES_FOR_SCIENCE_HOST_DIR} ${AFS_ROOT} +COPY ${ARCHES_TEMPLATING_HOST_DIR} ${TEMPLATING_ROOT} WORKDIR ${AFS_ROOT} RUN pip install -e . RUN pip uninstall arches -y +WORKDIR ${TEMPLATING_ROOT} +RUN pip install -e . + # afs app installed _before_ arches core - otherwise afs dependencies will overwrite arches editable install. WORKDIR ${ARCHES_ROOT} RUN pip install -e . --user && pip install -r arches/install/requirements.txt && pip install -r arches/install/requirements_dev.txt diff --git a/docker-compose.yml b/docker-compose.yml index c2346ac..ecc19d8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,14 +5,20 @@ services: container_name: disco image: fargeo/disco build: + args: + # These are not delivered from the env_file - they're from --build-arg arguments. + ARCHES_TEMPLATING_HOST_DIR: ../arches-templating/ + ARCHES_FOR_SCIENCE_HOST_DIR: ../arches-for-science/ + ARCHES_CORE_HOST_DIR: ../arches/ context: .. dockerfile: disco/Dockerfile command: run_arches volumes: - - ${ARCHES_CORE_DIR:-../arches/}:/web_root/arches + # To change these variables, modify/add the .env file prior to launch - NOT env_file.env + - ${ARCHES_CORE_HOST_DIR:-../arches/}:/web_root/arches - ./:/web_root/disco - - ${ARCHES_TEMPLATING_DIR:-../arches_templating/}:/web_root/arches_templating - - ${ARCHES_FOR_SCIENCE_DIR:-../arches-for-science/}:/web_root/arches-for-science + - ${ARCHES_TEMPLATING_HOST_DIR:-../arches-templating/}:/web_root/arches-templating + - ${ARCHES_FOR_SCIENCE_HOST_DIR:-../arches-for-science/}:/web_root/arches-for-science - $HOME/.aws/:/root/.aws/ - cantaloupe-data-disco:/web_root/disco/disco/uploadedfiles