Skip to content

Commit

Permalink
feat: Create simple endpoint for status (#1)
Browse files Browse the repository at this point in the history
* 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
diegolagospagopa authored Mar 7, 2023
1 parent 0a7e4e1 commit 3f72f27
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 174 deletions.
62 changes: 0 additions & 62 deletions .devops/docker-build.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
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

Expand Down
32 changes: 15 additions & 17 deletions app/main.py
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)
44 changes: 0 additions & 44 deletions app/routes/color.py

This file was deleted.

30 changes: 0 additions & 30 deletions app/routes/cosmosdb.py

This file was deleted.

9 changes: 0 additions & 9 deletions app/routes/status.py

This file was deleted.

8 changes: 2 additions & 6 deletions docker-compose.yml
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"
5 changes: 0 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
fastapi
uvicorn
pyyaml
unidecode
requests
dapr
python-random-strings

0 comments on commit 3f72f27

Please sign in to comment.