Skip to content

Commit

Permalink
Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rschiffer committed Apr 12, 2024
1 parent 5c94ec7 commit 6b278c7
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 11 deletions.
32 changes: 32 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#
FROM python:3.9 as requirements-stage

#
WORKDIR /tmp

#
RUN pip install poetry

#
COPY ./pyproject.toml ./poetry.lock* /tmp/

#
RUN poetry export -f requirements.txt --output requirements.txt --without-hashes --with api

#
FROM python:3.9

#
WORKDIR /code

#
COPY --from=requirements-stage /tmp/requirements.txt /code/requirements.txt

#
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt

#
COPY ./api /code/api

#
CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "80"]
10 changes: 0 additions & 10 deletions api/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,3 @@ def read_root():

app.include_router(yieldtablemeta.router)
app.include_router(yieldtable.router)


# @app.get("/items/{item_id}")
# def read_item(item_id: int, q: Union[str, None] = None):
# return {"item_id": item_id, "q": q}


# @app.get("/yield-tables-meta", response_model=List[YieldTableMeta])
# def read_yield_tables_meta():
# return get_yield_tables_meta()
12 changes: 11 additions & 1 deletion docs/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,19 @@ To run the pre-commit checks manually, use:
poetry run pre-commit run --all-files
```

### API

We use `fastapi` for the API. To run the API locally at
[http://127.0.0.1:8000](http://127.0.0.1:8000), use:

```bash
poetry run uvicorn api.main:app --reload
```

### Documentation

We use `mkdocs` for documentation. To run the documenation locally at [http://127.0.0.1:8000](http://127.0.0.1:8000), use:
We use `mkdocs` for documentation. To run the documenation locally at
[http://127.0.0.1:8000](http://127.0.0.1:8000), use:

```bash
poetry run mkdocs serve
Expand Down

0 comments on commit 6b278c7

Please sign in to comment.