Skip to content

Commit

Permalink
docker-compose -> docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
tompollard committed Aug 6, 2024
1 parent a779308 commit add0ee8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
24 changes: 12 additions & 12 deletions GuideForNewDevelopers.md
Original file line number Diff line number Diff line change
Expand Up @@ -766,7 +766,7 @@ cp .env.example .env
##### 3.1.6.3 Build the physionet image

```sh
docker-compose build
docker compose build
```

That should take care of all the setup for you, now let's go ahead start our server and load the demo data on our database.
Expand All @@ -776,7 +776,7 @@ That should take care of all the setup for you, now let's go ahead start our ser
To start our server, we can do it with a single command.

```sh
docker-compose up
docker compose up
```

This will start our development server on [http://localhost:8000](http://localhost:8000), run the postgres database, development and test containers. Before you go ahead and play around with the project, we need to load the demo data on our test and development database (Note: we only need to load the demo data when doing the setup for the first time).
Expand All @@ -793,7 +793,7 @@ cd physionet-build
Enter the development container shell and navigate inside `physionet-django` directory.

```sh
docker-compose exec dev /bin/bash
docker compose exec dev /bin/bash
```
```sh
cd physionet-django
Expand All @@ -811,7 +811,7 @@ Run the following commands to set up the database
In a new Terminal, enter the test container shell and navigate inside `physionet-django` directory.

```sh
docker-compose exec test /bin/bash
docker compose exec test /bin/bash
```
```sh
cd physionet-django
Expand Down Expand Up @@ -895,7 +895,7 @@ copy .env.example .env
##### 3.2.5.3 Build the physionet image

```cmd
docker-compose build
docker compose build
```

That should take care of all the setup for you, now let's go ahead start our server and load the demo data on our database.
Expand All @@ -905,7 +905,7 @@ That should take care of all the setup for you, now let's go ahead start our ser
To start our server, we can do it with a single command.

```cmd
docker-compose up
docker compose up
```

This will start our development server on [http://localhost:8000](http://localhost:8000), run the postgres database, development and test containers. Before you go ahead and play around with the project, we need to load the demo data on our test and development database (Note: we only need to load the demo data when doing the setup for the first time).
Expand All @@ -922,7 +922,7 @@ cd physionet-build
Enter the development container shell and navigate inside `physionet-django` directory.

```cmd
docker-compose exec dev /bin/bash
docker compose exec dev /bin/bash
```

```sh
Expand All @@ -941,7 +941,7 @@ Run the following commands to set up the database
In a new CMD, enter the test container shell and navigate inside `physionet-django` directory.

```cmd
docker-compose exec test /bin/bash
docker compose exec test /bin/bash
```
```sh
cd physionet-django
Expand Down Expand Up @@ -1036,7 +1036,7 @@ cp .env.example .env
##### 3.3.5.3 Build the physionet image

```sh
docker-compose build
docker compose build
```

That should take care of all the setup for you, now let's go ahead start our server and load the demo data on our database.
Expand All @@ -1046,7 +1046,7 @@ That should take care of all the setup for you, now let's go ahead start our ser
To start our server, we can do it with a single command.

```sh
docker-compose up
docker compose up
```

This will start our development server on [http://localhost:8000](http://localhost:8000), run the postgres database, development and test containers. Before you go ahead and play around with the project, we need to load the demo data on our test and development database (Note: we only need to load the demo data when doing the setup for the first time).
Expand All @@ -1063,7 +1063,7 @@ cd physionet-build
Enter the development container shell and navigate inside `physionet-django` directory.

```sh
docker-compose exec dev /bin/bash
docker compose exec dev /bin/bash
```
```sh
cd physionet-django
Expand All @@ -1081,7 +1081,7 @@ Run the following commands to set up the database
In a new terminal, enter the test container shell and navigate inside `physionet-django` directory.

```sh
docker-compose exec test /bin/bash
docker compose exec test /bin/bash
```
```sh
cd physionet-django
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,26 @@ The local development server will be available at [http://localhost:8000](http:/

- Install docker: [https://docs.docker.com/engine/install/](https://docs.docker.com/engine/install/).
- Copy the example config: `cp .env.example .env`.
- Build the physionet image: `docker-compose build`.
- Run `docker-compose up` to run the postgres database, development and test containers.
- Build the physionet image: `docker compose build`.
- Run `docker compose up` to run the postgres database, development and test containers.
- In a separate shell:
- Run: `docker-compose exec dev /bin/bash` to enter the development container shell.
- Run: `docker compose exec dev /bin/bash` to enter the development container shell.
- Within the `physionet-django` directory:
- Run: `python manage.py resetdb` to reset the database.
- Run: `python manage.py loaddemo` to load the demo fixtures set up example files.
- Run: `docker-compose exec test /bin/bash` to enter the test container shell.
- Run: `docker compose exec test /bin/bash` to enter the test container shell.
- Within the `physionet-django` directory:
- Run: `python manage.py resetdb` to reset the database.
- Run: `python manage.py loaddemo` to load the demo fixtures set up example files.
- Run: `python manage.py test` to run the tests.

The local development server will be available at [http://localhost:8000](http://localhost:8000).

All the management commands should be executed inside the desired container (with `docker-compose exec dev /bin/bash/` or `docker-compose exec test /bin/bash`).
All the management commands should be executed inside the desired container (with `docker compose exec dev /bin/bash/` or `docker compose exec test /bin/bash`).

The code should dynamically reload in development, however, if there are any issues you can stop the `docker-compose up` command and run `docker-compose up --build` which will rebuild the physionet image.
The code should dynamically reload in development, however, if there are any issues you can stop the `docker compose up` command and run `docker compose up --build` which will rebuild the physionet image.

Docker-compose uses volumes to persist the database contents and data directories (media and static files). To clean up the created containers, networks and volumes stop `docker-compose up` and run `docker-compose down -v`. Do not run `docker-compose down -v` if you want to retain current database contents.
Docker compose uses volumes to persist the database contents and data directories (media and static files). To clean up the created containers, networks and volumes stop `docker compose up` and run `docker compose down -v`. Do not run `docker compose down -v` if you want to retain current database contents.

## Background tasks

Expand Down Expand Up @@ -69,7 +69,7 @@ The debugger should now be available in the new shell.

## Testing

If using docker, all of the commands should run inside the test container (`docker-compose exec test /bin/bash`). You may need to `pip install coverage` beforehand if not using docker.
If using docker, all of the commands should run inside the test container (`docker compose exec test /bin/bash`). You may need to `pip install coverage` beforehand if not using docker.

- Unit tests for each app are kept in their `test*.py` files.
- To run the unit tests, change to the `physionet-django` directory and run `python manage.py test`.
Expand Down

0 comments on commit add0ee8

Please sign in to comment.