Skip to content
Snippets Groups Projects
Commit a116c141 authored by Remi  PLANEL's avatar Remi PLANEL
Browse files

add defense finder api using fastapi

parent 7d8d5bd2
No related branches found
No related tags found
1 merge request!1Django ninja
*.pyc
\ No newline at end of file
FROM python:3.10.7-slim-bullseye as requirements-stage
WORKDIR /tmp
RUN pip install poetry
COPY ./pyproject.toml ./poetry.lock* /tmp/
RUN poetry export -f requirements.txt --output requirements.txt --without-hashes
FROM python:3.10.7-slim-bullseye
WORKDIR /code
COPY --from=requirements-stage /tmp/requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
COPY ./defense_finder_api /code/defense_finder_api
ENTRYPOINT ["uvicorn", "defense_finder_api.main:app", "--host", "0.0.0.0"]
CMD [, "--port", "8000", "--reload"]
\ No newline at end of file
from typing import Union
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}
This diff is collapsed.
[tool.poetry]
name = "defense-finder-api"
version = "0.1.0"
description = ""
authors = ["Remi PLANEL <rplanel@pasteur.fr>"]
readme = "README.md"
packages = [{include = "defense_finder_api"}]
[tool.poetry.dependencies]
python = "^3.10"
fastapi = "^0.91.0"
uvicorn = {extras = ["standard"], version = "^0.20.0"}
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment