diff --git a/Dockerfile b/Dockerfile index 3160074..3f77a09 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,6 +13,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ tesseract-ocr-eng \ tesseract-ocr-hin \ libgl1 \ + curl \ && rm -rf /var/lib/apt/lists/* # Install Python dependencies (plain UTF-8 requirements.txt) @@ -22,15 +23,26 @@ RUN pip install --upgrade pip && pip install -r /tmp/requirements.txt # Copy app source COPY . /app +# Create non-root user and ensure directories exist for volume mounts +RUN useradd -m appuser && \ + mkdir -p /app/uploads /app/services/api/chroma_db && \ + chown -R appuser:appuser /app + +USER appuser + WORKDIR /app/services/api EXPOSE 8000 # --forwarded-allow-ips=* trusts X-Forwarded-For from nginx container # Required so rate limiter and audit logs see real client IPs (not nginx's internal IP) + +HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \ + CMD curl -f http://localhost:8000/health || exit 1 + +# B6 Fix: Drop --workers 4 to prevent scheduler from running 4 times concurrently CMD ["uvicorn", "app.main:app", \ "--host", "0.0.0.0", \ "--port", "8000", \ - "--workers", "4", \ "--proxy-headers", \ "--forwarded-allow-ips=*"] diff --git a/frontend/src/pages/UploadBusiness.jsx b/frontend/src/pages/UploadBusiness.jsx index acda337..51df949 100644 --- a/frontend/src/pages/UploadBusiness.jsx +++ b/frontend/src/pages/UploadBusiness.jsx @@ -167,7 +167,22 @@ export default function UploadBusiness() { const isApproved = latestDoc?.review_status === 'approved'; const isFiled = latestDoc?.review_status === 'filed'; return ( -