diff --git a/Makefile b/Makefile index 7e22328..60acffd 100644 --- a/Makefile +++ b/Makefile @@ -4,9 +4,21 @@ TOOLKIT_REPO = https://github.com/flaxandteal/arches-container-toolkit TOOLKIT_FOLDER = docker TOOLKIT_RELEASE = main ARCHES_PROJECT ?= $(shell ls -1 */__init__.py | head -n 1 | sed 's/\/.*//g') -ARCHES_BASE = ghcr.io/flaxandteal/arches-base:coral +ifeq ($(wildcard /../arches),) + ARCHES_ROOT=$(realpath ../arches) +else + + ARCHES_ROOT= +endif +ifneq ($(ARCHES_ROOT),) + DOCKER_COMPOSE_FILES = -f docker/docker-compose.yml -f docker/docker-compose.override.yml +else + DOCKER_COMPOSE_FILES = -f docker/docker-compose.yml +endif +APPS_VOLUME_MOUNTS=$(shell if [ -d "apps" ]; then for dir in apps/*; do if [ -d "$$dir" ]; then echo "-v $$(pwd)/$$dir:/web_root/$$dir "; fi; done; fi) +ARCHES_BASE = ghcr.io/flaxandteal/arches-base:docker-7.6 ARCHES_PROJECT_ROOT = $(shell pwd)/ -DOCKER_COMPOSE_COMMAND = ARCHES_PROJECT_ROOT=$(ARCHES_PROJECT_ROOT) ARCHES_BASE=$(ARCHES_BASE) ARCHES_PROJECT=$(ARCHES_PROJECT) docker-compose -p $(ARCHES_PROJECT) -f docker/docker-compose.yml +DOCKER_COMPOSE_COMMAND = ARCHES_PROJECT_ROOT=$(ARCHES_PROJECT_ROOT) ARCHES_BASE=$(ARCHES_BASE) ARCHES_PROJECT=$(ARCHES_PROJECT) ARCHES_ROOT=$(ARCHES_ROOT) docker compose -p $(ARCHES_PROJECT) $(DOCKER_COMPOSE_FILES) CMD ?= create: docker diff --git a/docker-compose.override.yml b/docker-compose.override.yml new file mode 100644 index 0000000..9f1e10d --- /dev/null +++ b/docker-compose.override.yml @@ -0,0 +1,14 @@ +version: '3.8' +services: + arches: + volumes: + - ${ARCHES_ROOT}:/web_root/arches + - ${ARCHES_ROOT}/docker/gunicorn_config.py:/web_root/arches/gunicorn_config.py + arches_api: + volumes: + - ${ARCHES_ROOT}:/web_root/arches + - ${ARCHES_ROOT}/docker/gunicorn_config.py:/web_root/arches/gunicorn_config.py + arches_worker: + volumes: + - ${ARCHES_ROOT}:/web_root/arches + - ${ARCHES_ROOT}/docker/gunicorn_config.py:/web_root/arches/gunicorn_config.py \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index e7cb234..7380888 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,8 +20,6 @@ services: volumes: - arches-log:/arches/arches/logs - arches-static:/static_root - - $ARCHES_ROOT:/web_root/arches - - $ARCHES_ROOT/docker/gunicorn_config.py:/web_root/arches/gunicorn_config.py # ./$ARCHES_PROJECT/media/node_modules/arches/docker/gunicorn_config.py:/web_root/arches/arches/gunicorn_config.py - ${ARCHES_PROJECT_ROOT}.:/web_root/$ARCHES_PROJECT - ${ARCHES_PROJECT_ROOT}./docker/entrypoint.sh:/web_root/entrypoint.sh @@ -105,8 +103,6 @@ services: volumes: - arches-log:/arches/arches/logs - arches-static:/static_root - - $ARCHES_ROOT:/web_root/arches - - $ARCHES_ROOT/docker/gunicorn_config.py:/web_root/arches/gunicorn_config.py # ./$ARCHES_PROJECT/media/node_modules/arches/docker/gunicorn_config.py:/web_root/arches/arches/gunicorn_config.py - ${ARCHES_PROJECT_ROOT}.:/web_root/$ARCHES_PROJECT - ${ARCHES_PROJECT_ROOT}./docker/entrypoint.sh:/web_root/entrypoint.sh @@ -160,8 +156,6 @@ services: volumes: - arches-log:/arches/arches/logs - arches-static:/static_root - - $ARCHES_ROOT:/web_root/arches - - $ARCHES_ROOT/docker/gunicorn_config.py:/web_root/arches/gunicorn_config.py # ./$ARCHES_PROJECT/media/node_modules/arches/docker/gunicorn_config.py:/web_root/arches/arches/gunicorn_config.py - ${ARCHES_PROJECT_ROOT}.:/web_root/$ARCHES_PROJECT - ${ARCHES_PROJECT_ROOT}./docker/entrypoint.sh:/web_root/entrypoint.sh