Not updating endpoints #579
Answered
by
vincentsarago
guillemc23
asked this question in
Q&A
-
I'm running Titiler inside a Docker. I'm running a very simple COG server with this code extracted from the docs: """Minimal COG tiler."""
from titiler.core.factory import TilerFactory
from titiler.core.errors import DEFAULT_STATUS_CODES, add_exception_handlers
from fastapi import FastAPI
app = FastAPI(title="Test Titiler")
cog = TilerFactory()
app.include_router(cog.router, tags=["Cloud Optimized GeoTIFF"])
add_exception_handlers(app, DEFAULT_STATUS_CODES)
@app.get("/healthz", description="Health Check", tags=["Health Check"])
def ping():
"""Health check."""
return {"ping": "pong!"}
@app.get("/test", description="Get test", tags=["Get test"])
def test():
return {"ping": "pung!"} I'm trying to add a new endpoint ( This is my Dockerfile: FROM ghcr.io/developmentseed/titiler:latest
COPY titiler/src /src
WORKDIR /src
# ENTRYPOINT ["python", "run.py"]
ENTRYPOINT [ "/bin/sleep", "9999999" ] My run.py: import uvicorn
import os
from multiprocessing import cpu_count
def start_server(host="0.0.0.0",
port=int(os.environ.get('PORT', 5003)),
num_workers=4,
loop="asyncio",
reload=True):
uvicorn.run("titiler.application.main:app",
host=host,
port=port,
workers=num_workers,
loop=loop,
reload=True)
if __name__ == "__main__":
num_workers = 1
start_server(num_workers=int(num_workers)) |
Beta Was this translation helpful? Give feedback.
Answered by
vincentsarago
Jan 27, 2023
Replies: 1 comment 1 reply
-
you need to point unicorn to you app not to |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
guillemc23
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
you need to point unicorn to you app not to
titiler.application.main:app