Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for Id (0.11 sec)

  1. docs/en/docs/deployment/docker.md

    from fastapi import FastAPI
    
    app = FastAPI()
    
    
    @app.get("/")
    def read_root():
        return {"Hello": "World"}
    
    
    @app.get("/items/{item_id}")
    def read_item(item_id: int, q: Union[str, None] = None):
        return {"item_id": item_id, "q": q}
    ```
    
    ### Dockerfile
    
    Now in the same project directory create a file `Dockerfile` with:
    
    ```{ .dockerfile .annotate }
    # (1)
    FROM python:3.9
    Plain Text
    - Registered: Sun May 05 07:19:11 GMT 2024
    - Last Modified: Thu May 02 22:37:31 GMT 2024
    - 34K bytes
    - Viewed (0)
Back to top