Skip to content

Commit

Permalink
Merge pull request #57 from mantidproject/update_docker_compose_calls
Browse files Browse the repository at this point in the history
Update to the new style of calling docker compose
  • Loading branch information
jhaigh0 authored May 1, 2024
2 parents 2894290 + 74809ef commit 3048e68
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions DevelopmentSetup.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ system.
As such, the only requirements for the host system are:

* Docker
* docker-compose
* docker compose

## Installing Docker

Expand Down Expand Up @@ -100,19 +100,19 @@ Some of the text such as the hash values may vary.

Congratulations your Docker installation is working!

## Installing docker-compose
## Installing docker compose

[Docker Compose](https://docs.docker.com/compose/) is a tool for configuring
and running applications by splitting them into multiple containers.
See the previous link for an introductory tutorial.

### macOS/Windows

`docker-compose` is now included within Docker Desktop so if you have used this
`docker compose` is now included within Docker Desktop so if you have used this
method you have the command already. Verify this by running:

```sh
>docker-compose version
>docker compose version
```

that should print the compose version.
Expand All @@ -134,7 +134,7 @@ Clone this repository locally:

## Creating an Environment (.env) File

The docker-compose configuration requires setting some environment variables
The docker compose configuration requires setting some environment variables
such as

* the port to run on
Expand Down Expand Up @@ -183,7 +183,7 @@ setting up for the first time.
To create the account run:

```sh
docker-compose exec web python manage.py createsuperuser
docker compose exec web python manage.py createsuperuser
```

and enter the requested details. Once the account has been created go to
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ To get started for development please follow the instructions in [DevelopmentSet
Old error reports can be removed with the following docker command:

```sh
docker-compose exec web python manage.py removeoldreports [ndays] [--all]
docker compose exec web python manage.py removeoldreports [ndays] [--all]
```

where reports older than `ndays` are removed (default=90).
Expand Down
6 changes: 3 additions & 3 deletions bin/boot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ mkdir -p "$SOURCE_DIR/pgdata"
# Start external network
create_external_net
# Build services
docker-compose --project-name ${PROJECT_NAME} build
docker compose --project-name ${PROJECT_NAME} build
# Bring up the stack and detach
docker-compose --project-name ${PROJECT_NAME} up --detach
docker compose --project-name ${PROJECT_NAME} up --detach

# Replace this loop with `--wait-timeout` when it is available
# with 'docker compose' v2
sleep_counter=0
while [ $(docker-compose ps --quiet --filter status=running | wc -l | xargs) -ne 4 ]
while [ $(docker compose ps --quiet --filter status=running | wc -l | xargs) -ne 4 ]
do
sleep 1
let counter++
Expand Down
2 changes: 1 addition & 1 deletion bin/shutdown.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SOURCE_DIR=$(cd "$SCRIPTPATH" && cd .. && pwd -P)
PROJECT_NAME=errorreports

cd ${SOURCE_DIR}
docker-compose down
docker compose down

# the web data volume shouldn't really be persistent as all of the files
# come from an image
Expand Down
4 changes: 2 additions & 2 deletions run_web_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ else
echo "Running tests using an existing environment file..."
fi

if [[ -z $(docker-compose ps --quiet --filter status=running $DJANGO_SERVICE_NAME) ]]; then
if [[ -z $(docker compose ps --quiet --filter status=running $DJANGO_SERVICE_NAME) ]]; then
echo "Booting services."
./bin/boot.sh
CLEAN_SERVICES=true
Expand All @@ -35,7 +35,7 @@ else
fi

echo "Executing web tests..."
docker-compose exec $DJANGO_SERVICE_NAME sh -c "python manage.py test $@"
docker compose exec $DJANGO_SERVICE_NAME sh -c "python manage.py test $@"

# Clean up
if [[ $CLEAN_SERVICES == true ]]; then
Expand Down

0 comments on commit 3048e68

Please sign in to comment.