Skip to content

Commit f78dd3e

Browse files
authored
Update setup.md
1 parent b354c6b commit f78dd3e

1 file changed

Lines changed: 22 additions & 12 deletions

File tree

docs/setup.md

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,42 @@ Source code repository for pandemos APIs.
77
```
88
git clone git@github.com:DLR-SC/ESID-Backend.git
99
```
10+
1011
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.
1217
```
1318
cp .docker-env.template .docker-env
1419
```
20+
21+
4. run docker compose:
1522
```
16-
docker compose --env-file .docker-env up --build -d
23+
docker compose up --build -d
1724
```
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.
2132
33+
5. Perform database migrations (Create tables - on initial run)
34+
- Generate code for migration:
2235
```
2336
docker compose exec api alembic revision --autogenerate -m "Create all tables"
2437
```
25-
26-
* Execute the migration
27-
38+
- Execute the migration
2839
```
2940
docker compose exec api alembic upgrade head
3041
```
3142
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
3543
3644
## API
37-
Goto http://localhost:8000
45+
Goto http://localhost:8000/
3846
3947
API docs can be found at:
4048
http://localhost:8000/docs
@@ -49,6 +57,8 @@ You can use `docker compose logs -f` to get a feed of the container logs.
4957
5058
`docker compose logs -f api db` to only see logs for the api & db containers.
5159
60+
You can attach to the containers to check their runtime environment with `docker exec -it <container-name> bash`.
61+
5262
watchgod will automatically restart the docker-ized Application with each code change.
5363
5464
## Development

0 commit comments

Comments
 (0)