Adds the ALLOW_ORIGINS environment variable to be set on the docker container. This is important for interfacing with the container from a website using fetch, as the browser will block the contents of the response if the appropriate headers are not present. This change ensures the headers are present on allowed origins.
It imports the middleware package from FastAPI to handle the origin matching.
The default behavior is to allow any origins *`** (Wild cards are supportedhttps://*.example.com`)
The variable is comma separated, so adding multiple origins can be done like so:
Add ALLOW_ORIGINS environment variable
Adds the ALLOW_ORIGINS environment variable to be set on the docker container. This is important for interfacing with the container from a website using fetch, as the browser will block the contents of the response if the appropriate headers are not present. This change ensures the headers are present on allowed origins. It imports the middleware package from FastAPI to handle the origin matching.
Example with docker-compose
The default behavior is to allow any origins *`
** (Wild cards are supported
https://*.example.com`) The variable is comma separated, so adding multiple origins can be done like so:Docs have also been updated with this information