init
This commit is contained in:
14
agent/Dockerfile.j2
Normal file
14
agent/Dockerfile.j2
Normal file
@@ -0,0 +1,14 @@
|
||||
FROM {{ base_image | default("python:3.11-slim") }}
|
||||
WORKDIR /app
|
||||
COPY . /app
|
||||
|
||||
{% set pip_opts = "" %}
|
||||
{% if pip_registry %}
|
||||
{% set pip_opts = "--index-url " ~ pip_registry %}
|
||||
{% endif %}
|
||||
|
||||
RUN pip install --no-cache-dir -U pip
|
||||
RUN pip install --no-cache-dir {{ pip_opts }} uvicorn fastapi
|
||||
RUN pip install --no-cache-dir {{ pip_opts }} -r requirements.txt
|
||||
|
||||
CMD ["uvicorn", "src.main:app", "--host", "0.0.0.0", "--port", "80"]
|
||||
10
agent/src_main.py.j2
Normal file
10
agent/src_main.py.j2
Normal file
@@ -0,0 +1,10 @@
|
||||
from fastapi import FastAPI
|
||||
|
||||
app = FastAPI()
|
||||
|
||||
@app.get("/")
|
||||
def root():
|
||||
"""
|
||||
This is an api that says, "Hello!"
|
||||
"""
|
||||
return {"response": "Hello ! {{ node_name }} !"}
|
||||
Reference in New Issue
Block a user