Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replaced use of deprecated docker-compose command in favour of docker compose #4191

Merged
merged 2 commits into from
May 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand All @@ -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
Expand Down Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions docs/source/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down