python
from fastapi import FastAPI
import uvicorn
app=FastAPI()
@app.get('/')
def index():
return 'Hello FastAPI'
if __name__ == "__main__":
uvicorn.run(app,host="0.0.0.0")
Dockerfile
python
FROM docker.1ms.run/python:3.12-slim
RUN pip install uv -i https://pypi.tuna.tsinghua.edu.cn/simple
COPY unisee /app/unisee
WORKDIR /app/unisee
RUN uv sync
EXPOSE 8000
ENTRYPOINT ["uv","run","main.py"]
podman build -t test:1.0 .
podman run --rm --name test p 8001:8000 test:1.0
>>>'Hello FastAPI'