generated from hjess/PythonTemplateProject
First real commit
Some checks failed
Build, Push, and Deploy to Nomad / docker-nomad (push) Failing after 29s
Some checks failed
Build, Push, and Deploy to Nomad / docker-nomad (push) Failing after 29s
This commit is contained in:
@@ -14,7 +14,7 @@ RUN pip install --no-cache-dir -r requirements.txt
|
|||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Expose the port the FastAPI app runs on (default Uvicorn port)
|
# Expose the port the FastAPI app runs on (default Uvicorn port)
|
||||||
EXPOSE 5000
|
EXPOSE 9210
|
||||||
|
|
||||||
# Command to run the FastAPI application
|
# Command to run the FastAPI application
|
||||||
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "5000", "--workers", "1"]
|
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "9210", "--workers", "1"]
|
||||||
5
app.py
5
app.py
@@ -1,3 +1,4 @@
|
|||||||
|
import uvicorn
|
||||||
from fastapi import FastAPI
|
from fastapi import FastAPI
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
import os
|
import os
|
||||||
@@ -9,3 +10,7 @@ app = FastAPI(title=os.getenv("APP_NAME", "Default App"))
|
|||||||
@app.get("/")
|
@app.get("/")
|
||||||
def read_root():
|
def read_root():
|
||||||
return {"debug": os.getenv("DEBUG", "false")}
|
return {"debug": os.getenv("DEBUG", "false")}
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
uvicorn.run("app:app", host="0.0.0.0", port=9210, reload=True)
|
||||||
Reference in New Issue
Block a user