Web App deployment with FastAPI

elsammonselsammons Member Posts: 6

Any one successfully deploy with FastAPI. This should be straight forward but my app is failing after running for a few seconds.

My app.sh

!/usr/bin/env bash
cd /mnt/app; python main.py

This works from a jupyterlab terminal just fine, not sure why the web app deployment is failing.

Comments

  • jaclyn.pattersonjaclyn.patterson Member, Administrator, Moderator, Domino Posts: 8 admin

    Are you getting any errors when you try to publish? Also, can you try moving your app.sh and main.py file into the /mnt directory and remove the cd command?

    Best,

    Jaclyn

  • katie.shakmankatie.shakman Administrator, Domino Posts: 192 admin

    Alternatively, if you need main.py to stay in the /mnt/app for any reason, you could try specifying the full path in your app.sh, e.g.:

    !/usr/bin/env bash
    python /mnt/app/main.py
    

    Note that you can also use the built-in Domino environment variable for the working directory instead of /mnt, which is useful in some situations where the Domino working directory might change (including if you have imported projects). If you do that, you would have something like this in app.sh:

    !/usr/bin/env bash
    python $DOMINO_WORKING_DIR/app/main.py
    


    Katie

    Customer Success Engineer @ Domino

  • elsammonselsammons Member Posts: 6
    edited August 6

    @jaclyn.patterson Looks like things are up and running (sort of). App Status is running and everything looks good in the execution details:

    INFO:     Uvicorn running on http://0.0.0.0:8000 (Press 
    

    However, I have no idea what IP the app is listening on and when I click view app I get nothing, but this could be related to FastAPI which requires that you navigate to https://<server>:<port>/docs to access the autodocumentation. Appending /docs to the end of the view app url did not work either.

    When I navigate to the web app via copy link or view app button I get the following:

    There Is No App Associated with This Project
    This project does not contain a published app. You can publish an app to share your work with others. Need help getting started? Read our support documentation
    


Sign In or Register to comment.