Skip to content

Commit

Permalink
add dev docker compose
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeWent committed Jul 17, 2024
1 parent 9174d35 commit a2b6462
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 9 deletions.
28 changes: 19 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,35 @@ UI: http://localhost:5000


## develop
run backend & frontend with live code reload:
```
docker compose -f docker-compose.yml -f docker-compose.dev.yml up
```
open http://localhost:8000/docs and http://localhost:5000

create local environment with all dependencies:
```console
pipenv install --dev
pipenv shell

cd api
pytest
uvicorn --host 0.0.0.0 --port 8000 api.app:app --reload

cd ui
gunicorn --bind 0.0.0.0:5000 ui.app:app --reload
```
- open any .py file in vscode
- choose newly created env as python interpreter (bottom right button)
- now vscode intellisense will work correctly for all packages

on Pipfile changes:
if you need to change the Pipfile:
```console
pipenv requirements --exclude-markers --dev > requirements.txt
cp requirements.txt ui
cp requirements.txt api
```

to run api tests:
```
pipenv shell
cd api
pytest
```


## todo
- [x] base classes
- [x] errors
Expand Down
10 changes: 10 additions & 0 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
services:
api:
volumes:
- ./api:/opt/api
command: --reload

ui:
volumes:
- ./ui:/opt/ui
command: --reload

0 comments on commit a2b6462

Please sign in to comment.