To run this project:
- first clone the
.env.example
file and fill the required variables. - Run
docker compose up --build
- Run migrations. See migrations section below
- Access the api through localhost:8000
In order to run migrations:
Attach a terminal to the container and run alembic upgrade
docker container list
docker exec -it <container name> bash
alembic upgrade head
To run test attach a terminal to the container:
docker container list
docker exec -it <container name> bash
then run:
pytest -vs
# coverage
coverage --branch -m pytest -vs
coverage html
docker run -ti \
--network weather_api_default \
--net-alias api \
-p 8000:8000 \
-v /${PWD}/src:/usr/src \
-e "environment=development" \
weather_api_api