Skip to content

EphraimHaber/fapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fapi

this POC project uses fast-api which is not installed on my local machine. I will config pycharm to use a remote interpreter from the container.

Let's go step by step:

  1. Open a terminal in the fapi directory.
  2. run docker compose up --build -d
image
  1. Note that this doesn't give us autocomplete. Even though the code runs and reacts to changes in the file, that is because of the volume defined in the dokcer-compose.yaml file
  2. Click ctrl+shift+s
  3. Go to the project python interpreter
  4. On the top right corner of the screen click Add Interpreter > On Docker compose
  5. image
  6. Click Apply > Ok
  7. Click Next > Next > Create

Note that in order for this to connect we will need the BusyBox image.

https://hub.docker.com/_/busybox

9* You will need to transfer that image to your air gapped network if you are using one. the following line is the relevent line when I run docker images on my host machine

busybox            latest            a416a98b71e2   2 weeks ago      4.26MB
  1. This will build (now offline) another image pycharm_helpers (and spin a container of course)

  2. You now have intellisense from the IDE.

  3. In order to debug we will need to make a debug run config

    image
  4. Click on the green triangle and then on Debug main

    image
  5. This should make a run config. In case you need here is the one I made.

image
  1. I've put a breakpoint on line 10 and then retried to load http://localhost:8000/

    image

And that's it. Good luck!.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published