From f0b2687ba4e120aea8b23537c35ce0690dde1e42 Mon Sep 17 00:00:00 2001 From: Phil Weir Date: Sat, 7 Dec 2024 22:10:03 +0000 Subject: [PATCH] wip: corrections for arches 7.6 --- Dockerfile | 3 ++- Dockerfile.static | 2 +- docker-compose.yml | 11 +++++++---- entrypoint.sh | 7 +------ 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6d4b846..3057da9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,8 @@ RUN . ../ENV/bin/activate \ COPY . ${WEB_ROOT}/${ARCHES_PROJECT}/ RUN . ../ENV/bin/activate \ && pip install cachetools websockets pika "protobuf>4.21,<5.0" \ - && (if [ -f ${WEB_ROOT}/${ARCHES_PROJECT}/requirements.txt ]; then pip install -r ${WEB_ROOT}/${ARCHES_PROJECT}/requirements.txt --no-binary :all:; fi) + && (if [ -f ${WEB_ROOT}/${ARCHES_PROJECT}/requirements.txt ]; then pip install -r ${WEB_ROOT}/${ARCHES_PROJECT}/requirements.txt --no-binary :all:; fi) \ + && (if [ -f ${WEB_ROOT}/${ARCHES_PROJECT}/pyproject.toml ]; then (cd ${WEB_ROOT}/${ARCHES_PROJECT} && pip install -e .); fi) RUN mkdir -p ${WEB_ROOT}/${ARCHES_PROJECT}/${ARCHES_PROJECT}/uploadedfiles && chgrp -R arches ${WEB_ROOT}/${ARCHES_PROJECT}/${ARCHES_PROJECT}/uploadedfiles && chmod -R g+rw ${WEB_ROOT}/${ARCHES_PROJECT}/${ARCHES_PROJECT}/uploadedfiles diff --git a/Dockerfile.static b/Dockerfile.static index f63fcee..2cb7c40 100644 --- a/Dockerfile.static +++ b/Dockerfile.static @@ -59,7 +59,7 @@ RUN (echo "\nARCHES_NAMESPACE_FOR_DATA_EXPORT='${ARCHES_NAMESPACE_FOR_DATA_EXPOR RUN (echo "\nPUBLIC_SERVER_ADDRESS='${PUBLIC_SERVER_ADDRESS}' or ARCHES_NAMESPACE_FOR_DATA_EXPORT" >> ${WEB_ROOT}/${ARCHES_PROJECT}/${ARCHES_PROJECT}/settings_local.py) && echo $STATIC_ROOT RUN (cd $WEB_ROOT/arches/arches && NODE_OPTIONS=--max_old_space_size=8192 NODE_PATH=$WEB_ROOT/$ARCHES_PROJECT/$ARCHES_PROJECT/media/node_modules npm install) -RUN (cd $WEB_ROOT/$ARCHES_PROJECT/$ARCHES_PROJECT && NODE_OPTIONS=--max_old_space_size=8192 NODE_PATH=./media/node_modules npm install -D) +RUN (cd $WEB_ROOT/$ARCHES_PROJECT/$ARCHES_PROJECT && NODE_OPTIONS=--max_old_space_size=8192 NODE_PATH=./media/node_modules npm install -D && ls ./media/node_modules) RUN apt-get update && apt-get -y install python3-libxml2 git RUN /bin/bash -c ". ../ENV/bin/activate;\ python manage.py createcachetable;\ diff --git a/docker-compose.yml b/docker-compose.yml index c0c185c..e7cb234 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,7 +26,8 @@ services: - ${ARCHES_PROJECT_ROOT}.:/web_root/$ARCHES_PROJECT - ${ARCHES_PROJECT_ROOT}./docker/entrypoint.sh:/web_root/entrypoint.sh - ${ARCHES_PROJECT_ROOT}./docker/settings_docker.py:/web_root/$ARCHES_PROJECT/$ARCHES_PROJECT/settings_local.py - - ${ARCHES_PROJECT_ROOT}./../arches-orm/arches_orm:/web_root/ENV/lib/python3.10/site-packages/arches_orm + - ${ARCHES_PROJECT_ROOT}./../arches-orm/arches_orm:/web_root/ENV/lib/python3.12/site-packages/arches_orm + - ${ARCHES_PROJECT_ROOT}./../arches_doorstep/arches_doorstep:/web_root/ENV/lib/python3.12/site-packages/arches_doorstep environment: - ARCHES_PROJECT=$ARCHES_PROJECT - INSTALL_DEFAULT_GRAPHS=False @@ -110,8 +111,9 @@ services: - ${ARCHES_PROJECT_ROOT}.:/web_root/$ARCHES_PROJECT - ${ARCHES_PROJECT_ROOT}./docker/entrypoint.sh:/web_root/entrypoint.sh - ${ARCHES_PROJECT_ROOT}./docker/settings_docker.py:/web_root/$ARCHES_PROJECT/$ARCHES_PROJECT/settings_local.py - - ${ARCHES_PROJECT_ROOT}./../arches-orm/arches_orm:/web_root/ENV/lib/python3.10/site-packages/arches_orm - #- ${ARCHES_PROJECT_ROOT}./../.env/lib/python3.11/site-packages/graphql:/web_root/ENV/lib/python3.10/site-packages/graphql + - ${ARCHES_PROJECT_ROOT}./../arches-orm/arches_orm:/web_root/ENV/lib/python3.12/site-packages/arches_orm + - ${ARCHES_PROJECT_ROOT}./../arches_doorstep/arches_doorstep:/web_root/ENV/lib/python3.12/site-packages/arches_doorstep + #- ${ARCHES_PROJECT_ROOT}./../.env/lib/python3.11/site-packages/graphql:/web_root/ENV/lib/python3.12/site-packages/graphql environment: - ARCHES_PROJECT=$ARCHES_PROJECT - GUNICORN_WORKERS=1 @@ -164,7 +166,8 @@ services: - ${ARCHES_PROJECT_ROOT}.:/web_root/$ARCHES_PROJECT - ${ARCHES_PROJECT_ROOT}./docker/entrypoint.sh:/web_root/entrypoint.sh - ${ARCHES_PROJECT_ROOT}./docker/settings_docker.py:/web_root/$ARCHES_PROJECT/$ARCHES_PROJECT/settings_local.py - - ${ARCHES_PROJECT_ROOT}./../arches-orm/arches_orm:/web_root/ENV/lib/python3.10/site-packages/arches_orm + - ${ARCHES_PROJECT_ROOT}./../arches-orm/arches_orm:/web_root/ENV/lib/python3.12/site-packages/arches_orm + - ${ARCHES_PROJECT_ROOT}./../arches_doorstep/arches_doorstep:/web_root/ENV/lib/python3.12/site-packages/arches_doorstep environment: - ARCHES_PROJECT=$ARCHES_PROJECT - INSTALL_DEFAULT_GRAPHS=False diff --git a/entrypoint.sh b/entrypoint.sh index 6ad17ac..c24bcb3 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -30,12 +30,7 @@ fi # Read modules folder from npm config file # Get string after '--install.modules-folder' -> get first word of the result # -> remove line endlings -> trim quotes -> trim leading ./ -NPM_MODULES_FOLDER=${PACKAGE_JSON_FOLDER}/$(awk \ - -F '--install.modules-folder' '{print $2}' ${PACKAGE_JSON_FOLDER} \ - | awk '{print $1}' \ - | tr -d $'\r' \ - | tr -d '"' \ - | sed -e "s/^\.\///g") +NPM_MODULES_FOLDER=${PACKAGE_JSON_FOLDER}/media/node_modules export DJANGO_PORT=${DJANGO_PORT:-8000} STATIC_ROOT=${STATIC_ROOT:-/static_root}