Final audit fixes: D&D, Docker security, Seed script, review events

This commit is contained in:
Atharv1705
2026-10-01 14:36:02 +05:30
parent 0ca44bc3f4
commit 7add0adb7e
5 changed files with 112 additions and 8 deletions
+13 -1
View File
@@ -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=*"]