diff --git a/Dockerfile b/Dockerfile index 4705e4f..a6f3cb8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,10 +2,10 @@ FROM python:3.10-slim WORKDIR /app -RUN pip install --no-cache-dir fastapi uvicorn requests +RUN pip install --no-cache-dir fastapi uvicorn -COPY . . +COPY app.py . EXPOSE 8000 -CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"] +CMD ["python", "app.py"] diff --git a/app.py b/app.py index 94852b6..20c4ee8 100644 --- a/app.py +++ b/app.py @@ -1,5 +1,6 @@ from fastapi import FastAPI from fastapi.responses import HTMLResponse +import uvicorn import time app = FastAPI() @@ -27,10 +28,9 @@ def health_check(): def get_dashboard(): global request_count request_count += 1 - uptime = round(time.time() - start_time, 2) - html_content = f""" + return f"""
@@ -40,19 +40,15 @@ def get_dashboard(): body {{ font-family: system-ui, sans-serif; background: #0f172a; color: #fff; padding: 40px; text-align: center; }} .container {{ max-width: 800px; margin: 0 auto; }} .grid {{ display: flex; gap: 20px; margin-top: 30px; }} - .card {{ background: #1e293b; padding: 25px; border-radius: 12px; flex: 1; border: 1px solid #334155; box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); }} + .card {{ background: #1e293b; padding: 25px; border-radius: 12px; flex: 1; border: 1px solid #334155; }} .status-up {{ color: #22c55e; font-weight: bold; }} - h1 {{ font-size: 2.5rem; margin-top: 10px; color: #38bdf8; }} - p {{ color: #94a3b8; }} + h1 {{ font-size: 2.5rem; color: #38bdf8; }} - +تحديث تلقائي كل 5 ثوانٍ
تحديث تلقائي كل 5 ثوانٍ