-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Create simple endpoint for status (#1)
* deleted old files * fix docker file and docker-compose * created status and healt endpoints * minor fix * requirements: removed dependencies not more used
- Loading branch information
1 parent
0a7e4e1
commit 3f72f27
Showing
8 changed files
with
18 additions
and
174 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
FROM python:3.10-slim-buster | ||
FROM python:3.10-alpine | ||
|
||
WORKDIR /code | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,25 @@ | ||
from fastapi import FastAPI | ||
from app.routes.color import color | ||
from app.routes.status import status_route | ||
from app.routes.cosmosdb import cosmosdb | ||
|
||
|
||
def include_router(app): | ||
app.include_router(color, prefix='/color') | ||
app.include_router(status_route, prefix='/status') | ||
app.include_router(cosmosdb, prefix='/cosmosdb') | ||
|
||
|
||
def configure_application(app): | ||
include_router(app) | ||
return app | ||
from fastapi import FastAPI, Response | ||
from http import HTTPStatus | ||
|
||
|
||
app = FastAPI() | ||
|
||
|
||
@app.get("/") | ||
async def home_root(): | ||
return {"home_root": "ok"} | ||
return Response(status_code=HTTPStatus.OK) | ||
|
||
|
||
@app.get("/status") | ||
async def status(): | ||
return Response(status_code=HTTPStatus.OK) | ||
|
||
|
||
@app.get("/health") | ||
async def health(): | ||
return Response(status_code=HTTPStatus.OK) | ||
|
||
configure_application(app) | ||
|
||
@app.get("/healthz") | ||
async def healthz(): | ||
return Response(status_code=HTTPStatus.OK) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,10 @@ | ||
version: "3.8" | ||
services: | ||
webapp-python: | ||
# image: "devops-webapp-python:latest" | ||
status: | ||
build: | ||
dockerfile: ./Dockerfile | ||
context: . | ||
container_name: webapp-python | ||
container_name: status | ||
restart: always | ||
environment: | ||
- MY_CONFIGMAP_VALUE=1 | ||
- MY_SECRET_VALUE=very secret 1 | ||
ports: | ||
- "8000:8000" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,2 @@ | ||
fastapi | ||
uvicorn | ||
pyyaml | ||
unidecode | ||
requests | ||
dapr | ||
python-random-strings |