-
Notifications
You must be signed in to change notification settings - Fork 238
Description
Currently there is no clear instructions on how to deploy Feathr UI and REST API, we should have clear instructions on how to do this.
Furthermore, currently the E2E deployment experience is a bit complex for getting started. Following describes steps required:
- Build a docker image for REST API, publish to container registry
- Deploy REST API as a container app
- Update UI configuration to use api endpoint created in step 2, build a docker image for UI, publish to container registry
- Depoy UI as a container app
Propose to simplify this into one nginx based docker image so both Feathr UI and REST API can be run as one single container app. Using nginx as load balancer is very popular among modern tech stack engineers.
Pseudo nginx configuration:
location / {
# Serve static frontend react app
try_files $uri $uri/ /index.html;
}
location /api {
# serve backend FastAPI app
proxy_pass http://localhost:8000; /
}
Another option is leverage FastAPI's static file serve to host ui static files without nginx. However, this is not recommended due to performance concerns of FastAPI. There is one more benefit for using nginx, in case REST API is rewritten by a different language, the nginx config can continue to work without changes.