To run the full stack in Docker compose please use the following instructions:
-
Build images with
docker compose -f docker-compose.yml build
-
Run all docker services with
docker compose up --scale backend=4
. This will start the services with four instances of the backend running in parallel. -
Default url for backend will be
http://clowder.docker.localhost/
using a web browser. If using a different client (for example postman set theHOST
header toclowder.docker.localhost
). This variable is set using thetraefik.http.routers.backend.rule
for the backend service. -
To access the traefik dashboard go to
http://localhost:8080
. For the raw settings seehttp://localhost:8080/api/rawdata
. -
Minio console is available at
minioconsole.docker.localhost
.
When developing please follow the following instructions:
-
Start mongo and minio using provided development docker compose file:
docker compose -f docker-compose.dev.yml up
-
Install dependencies using
pipenv install
. See pipenv. -
Run app from command line (if you set it up in PyCharm you can use its debug functions):
uvicorn app.main:app --reload
-
API docs are available at
http://localhost:8000/docs
. Default API is deployed athttp://localhost:8000/api/v2
. -
Create a user using
POST /api/v2/users
and getting a JWT token by usingPOST /api/v2/login
. Place the token in header of requests that require authentications using theAuthorization: Bearer <your token>
HTTP header. -
Manually run tests before pushing with
pipenv run pytest -v
or right-clicking ontest
folder and clickingRun
in PyCharm. -
Linting is managed using Black. You can set up PyCharm to automatically run it when you save a file using these instructions. The git repository includes an action to run Black on push and pull_request.