diff --git a/Makefile b/Makefile index 6bd6dc33d..4f8f33a6e 100644 --- a/Makefile +++ b/Makefile @@ -69,6 +69,7 @@ export JANEWAY_EMAIL_HOST export JANEWAY_EMAIL_PORT export JANEWAY_EMAIL_USE_TLS +COMPOSE_CMD ?= docker compose SUFFIX ?= $(shell date +%s) SUFFIX := ${SUFFIX} DATE := `date +"%y-%m-%d"` @@ -79,20 +80,20 @@ run: janeway help: ## Show this help. @fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##//' janeway: ## Run Janeway web server in attached mode. If NO_DEPS is not set, runs all dependant services detached. - docker-compose run --rm start_dependencies - docker-compose $(_VERBOSE) run $(NO_DEPS) --rm --service-ports janeway-web $(entrypoint) + $(COMPOSE_CMD) run --rm start_dependencies + $(COMPOSE_CMD) $(_VERBOSE) run $(NO_DEPS) --rm --service-ports janeway-web $(entrypoint) command: ## Run Janeway in a container and pass through a django command passed as the CMD environment variable (e.g make command CMD="migrate -v core 0024") - docker-compose run $(NO_DEPS) --rm janeway-web $(CMD) + $(COMPOSE_CMD) run $(NO_DEPS) --rm janeway-web $(CMD) install: ## Run the install_janeway command inside a container touch db/janeway.sqlite3 mkdir -p db/postgres-data - docker-compose run --rm start_dependencies + $(COMPOSE_CMD) run --rm start_dependencies bash -c "make command CMD=install_janeway" rebuild: ## Rebuild the Janeway docker image. docker pull birkbeckctp/janeway-base:latest - docker-compose build --no-cache janeway-web + $(COMPOSE_CMD) build --no-cache janeway-web shell: ## Runs the janeway-web service and starts an interactive bash process instead of the webserver - docker-compose run --service-ports --entrypoint=/bin/bash --rm janeway-web + $(COMPOSE_CMD) run --service-ports --entrypoint=/bin/bash --rm janeway-web attach: ## Runs an interactive shell within the currently running janeway-web container. docker exec -ti `docker ps -q --filter 'name=janeway-web'` /bin/bash db-client: ## runs the database CLI client interactively within the database container as per the value of DB_VENDOR @@ -136,7 +137,7 @@ build_assets: ## Runs Janeway's build_assets command basebuild: ## Builds the base docker image bash -c "docker build --no-cache -t birkbeckctp/janeway-base:latest -f dockerfiles/Dockerfile.base ." snakeviz: - docker-compose run --publish $(SNAKEVIZ_PORT):$(SNAKEVIZ_PORT) $(NO_DEPS) --rm --entrypoint=snakeviz janeway-web $(FILE) --server -H 0.0.0.0 -p $(SNAKEVIZ_PORT) + $(COMPOSE_CMD) run --publish $(SNAKEVIZ_PORT):$(SNAKEVIZ_PORT) $(NO_DEPS) --rm --entrypoint=snakeviz janeway-web $(FILE) --server -H 0.0.0.0 -p $(SNAKEVIZ_PORT) ci: ## Runs Janeway's CI job in a container docker build -t janeway_jenkins_build_${BUILD_TAG}_ci -f jenkins/Dockerfile.jenkins . echo "Running Unit Tests and Coverage" diff --git a/README.md b/README.md index 7236d6208..f1d12f5ba 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Developer installation [instructions are available in our documentation site](ht A guide for installing on the live environment with [apache and mod_wsgi](https://github.com/BirkbeckCTP/janeway/wiki/Janeway%2C-Apache-and-WSGI) is also available. ## Running Janeway with docker -Janeway's development server can be run within a docker container, avoiding the need to install and run its dependencies from your machine. A docker-compose file as well as a Makefile can be found at the root of the project wrapping the most common operations. +Janeway's development server can be run within a docker container, avoiding the need to install and run its dependencies from your machine. A docker compose file as well as a Makefile can be found at the root of the project wrapping the most common operations. Docker is compatible with multiple architectures and Operating systems, if you need help installing docker, have a look at the [docker documentation](https://docs.docker.com/install/). Simarly to the native installation, Janeway can be installed in a docker environment by running ``make install`` and following the installation steps described [above](https://github.com/BirkbeckCTP/janeway/wiki/Installation). As a result, a database volume will be populated under janeway/db/postgres-data diff --git a/docs/source/installation.rst b/docs/source/installation.rst index bb4d4925c..7060e3c6b 100644 --- a/docs/source/installation.rst +++ b/docs/source/installation.rst @@ -2,9 +2,9 @@ Installation Guide ================== There are a number of ways to get Janeway up and running. For development we recommend you use Docker with Postgres as the DB_VENDOR. A Lando configuration is also included. -Running Janeway with Docker and docker-compose +Running Janeway with Docker and docker compose ---------------------------------------------- -1. Install ``docker``, ``docker-compose`` and ``GNU Make``. +1. Install ``docker`` and ``GNU Make``. 2. From the /path/to/janeway directory run ``make install``. 3. A docker environment will be provisioned, and shortly after the janeway install script will run. Follow the instructions on screen to complete the installation. 4. Once install is complete run ``make run`` to run the django development server against a Postgres backend.