-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
108 additions
and
1,930 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
version: 2 | ||
|
||
sphinx: | ||
configuration: docs/conf.py | ||
|
||
python: | ||
version: 3.8 | ||
install: | ||
- method: pip | ||
path: . | ||
extra_requirements: | ||
- docs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.8.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# syntax=docker/dockerfile:experimental | ||
FROM python:3.8.8 | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
gcc \ | ||
ffmpeg \ | ||
libsm6 \ | ||
libxext6 \ | ||
git \ | ||
curl | ||
|
||
RUN curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - | ||
|
||
WORKDIR /app | ||
COPY pyproject.toml . | ||
COPY poetry.lock . | ||
|
||
RUN ~/.poetry/bin/poetry install | ||
|
||
COPY app app | ||
|
||
EXPOSE 8000 | ||
|
||
CMD ["/root/.poetry/bin/poetry", "run", "python", "-m", "app.main", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Example with keycloak | ||
|
||
## Setup your realm | ||
|
||
1. Start up keycloak with `docker-compose up` (the fastapi app will crash since | ||
we do not have a realm yet). | ||
2. Log into keycloak at http://localhost:8080 with username/password `admin/admin`. | ||
3. Create a realm `my-realm`. This will set your `openid_connect_url` to `http://localhost:8080/auth/realms/my-realm/.well-known/openid-configuration` | ||
and your issuer to `http://localhost:8080/auth/realms/my-realm`. | ||
4. Allow implicit flow (in order for login in interactive docs to work). | ||
5. Create a user and add credentials (password). | ||
|
||
## Login into docs with your credentials | ||
|
||
1. Kill app and then restart with `docker-compose up`. | ||
2. Go to `http://localhost:8000/docs` and login with your credentials by | ||
clicking `authorize` in the top right corner. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from pydantic import BaseSettings | ||
from pydantic import Field | ||
|
||
|
||
class Config(BaseSettings): | ||
openid_connect_url: str = Field(..., env="AUTH_OPENID_CONNECT_URL") | ||
issuer: str = Field(..., env="AUTH_ISSUER") | ||
client_id: str = Field(..., env="AUTH_CLIENT_ID") | ||
|
||
|
||
config = Config() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.