Skip to content

Commit b165e0a

Browse files
Document that we need to use -v flag when running docker compose down
1 parent e1ee3d7 commit b165e0a

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

docs/installation.qmd

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ If you use VSCode with Docker to develop in a container, the following VSCode De
2020

2121
Simply create a `.devcontainer` folder in the root of the project and add a `devcontainer.json` file in the folder with the above content. VSCode may prompt you to install the Dev Container extension if you haven't already, and/or to open the project in a container. If not, you can manually select "Dev Containers: Reopen in Container" from View > Command Palette.
2222

23+
*IMPORTANT: If using this dev container configuration, you will need to set the `DB_HOST` environment variable to "host.docker.internal" in the `.env` file.*
24+
2325
## Install development dependencies manually
2426

2527
### Python and Docker
@@ -103,15 +105,32 @@ Set your desired database name, username, and password in the .env file.
103105

104106
To use password recovery, register a [Resend](https://resend.com/) account, verify a domain, get an API key, and paste the API key into the .env file.
105107

108+
If using the dev container configuration, you will need to set the `DB_HOST` environment variable to "host.docker.internal" in the .env file. Otherwise, set `DB_HOST` to "localhost" for local development. (In production, `DB_HOST` will be set to the hostname of the database server.)
109+
106110
## Start development database
107111

112+
To start the development database, run the following command in your terminal from the root directory:
113+
108114
``` bash
109115
docker compose up -d
110116
```
111117

118+
If at any point you change the environment variables in the .env file, you will need to stop the database service *and tear down the volume*:
119+
120+
``` bash
121+
# Don't forget the -v flag to tear down the volume!
122+
docker compose down -v
123+
```
124+
125+
You may also need to restart the terminal session to pick up the new environment variables. You can also add the `--force-recreate` and `--build` flags to the startup command to ensure the container is rebuilt:
126+
127+
``` bash
128+
docker compose up -d --force-recreate --build
129+
```
130+
112131
## Run the development server
113132

114-
Make sure the development database is running and tables and default permissions/roles are created first.
133+
Before running the development server, make sure the development database is running and tables and default permissions/roles are created first. Then run the following command in your terminal from the root directory:
115134

116135
``` bash
117136
uvicorn main:app --host 0.0.0.0 --port 8000 --reload

index.qmd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ To use password recovery, register a [Resend](https://resend.com/) account, veri
107107

108108
### Start development database
109109

110+
To start the development database, run the following command in your terminal from the root directory:
111+
110112
``` bash
111113
docker compose up -d
112114
```

0 commit comments

Comments
 (0)