Fix deployment verification and clean submission
هذا الالتزام موجود في:
@@ -1,5 +1,7 @@
|
||||
FROM python:3.12-slim
|
||||
|
||||
ARG RELEASE_SHA=local
|
||||
|
||||
# curl is required by the HEALTHCHECK below; everything else stays out of the image.
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends curl \
|
||||
@@ -8,6 +10,7 @@ RUN apt-get update \
|
||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
PIP_NO_CACHE_DIR=1 \
|
||||
RELEASE_SHA=${RELEASE_SHA} \
|
||||
PORT=8080
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
@@ -15,6 +15,7 @@ from fastapi.responses import JSONResponse
|
||||
|
||||
APP_NAME = os.getenv("APP_NAME", "ghaymah-api")
|
||||
APP_VERSION = os.getenv("APP_VERSION", "1.0.0")
|
||||
RELEASE_SHA = os.getenv("RELEASE_SHA", "local")
|
||||
PORT = int(os.getenv("PORT", "8080"))
|
||||
|
||||
# Process start time drives both uptime and the /metrics started_at field.
|
||||
@@ -53,6 +54,7 @@ async def root():
|
||||
return {
|
||||
"service": APP_NAME,
|
||||
"version": APP_VERSION,
|
||||
"release": RELEASE_SHA,
|
||||
"message": "Ghaymah deployment demo API",
|
||||
"endpoints": ["/", "/health", "/metrics", "/docs"],
|
||||
"started_at": STARTED_AT_ISO,
|
||||
@@ -68,6 +70,7 @@ async def health():
|
||||
status_code=200,
|
||||
content={
|
||||
"status": "ok",
|
||||
"release": RELEASE_SHA,
|
||||
"uptime_s": _uptime_s(),
|
||||
"timestamp": _now_iso(),
|
||||
},
|
||||
|
||||
المرجع في مشكلة جديدة
حظر مستخدم