You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/setup.md
+22-12Lines changed: 22 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,34 +7,42 @@ Source code repository for pandemos APIs.
7
7
```
8
8
git clone git@github.com:DLR-SC/ESID-Backend.git
9
9
```
10
+
10
11
2. Go to `api` directory.
11
-
3. Create `docker-env` and run docker compose:
12
+
```
13
+
cd api/
14
+
```
15
+
16
+
3. Create `docker-env` and modify the file as needed.
12
17
```
13
18
cp .docker-env.template .docker-env
14
19
```
20
+
21
+
4. run docker compose:
15
22
```
16
-
docker compose --env-file .docker-env up --build -d
23
+
docker compose up --build -d
17
24
```
18
-
4. Perform database migrations (Create tables - on initial run)
19
-
20
-
* Generate code for migration
25
+
> [!NOTE]
26
+
> In older docker compose versions you may need to provide the .env file because the file is not recognized in the `docker-compose.yml`
27
+
> In this case add `--env-file .docker-env`:
28
+
> ```
29
+
> docker compose --env-file .docker-env up --build -d
30
+
> ```
31
+
> The other commands in theory need the env reference too, but should work without despite any warnings.
21
32
33
+
5. Perform database migrations (Create tables - on initial run)
34
+
- Generate code for migration:
22
35
```
23
36
docker compose exec api alembic revision --autogenerate -m "Create all tables"
24
37
```
25
-
26
-
* Execute the migration
27
-
38
+
- Execute the migration
28
39
```
29
40
docker compose exec api alembic upgrade head
30
41
```
31
42
32
-
> [!NOTE]
33
-
> In older docker compose versions you may need to provide the .env file in each command (3 & 4) because the file is not recognized in the docker-compose.yml
34
-
> In this case add `--env-file .docker-env` directly after `docker compose` and before the rest of the commands
35
43
36
44
## API
37
-
Goto http://localhost:8000
45
+
Goto http://localhost:8000/
38
46
39
47
API docs can be found at:
40
48
http://localhost:8000/docs
@@ -49,6 +57,8 @@ You can use `docker compose logs -f` to get a feed of the container logs.
49
57
50
58
`docker compose logs -f api db` to only see logs for the api & db containers.
51
59
60
+
You can attach to the containers to check their runtime environment with `docker exec -it <container-name> bash`.
61
+
52
62
watchgod will automatically restart the docker-ized Application with each code change.
0 commit comments