Add scan cache tracking and improve health checks
- Track scanned FTP directories in MongoDB to avoid redundant scans - Add endpoints to view and clear scan cache - Improve health check logic for better startup and error reporting - Add readiness endpoint for deployment probes - Add test script for health check improvements - Increase logging verbosity for debugging
This commit is contained in:
@@ -10,10 +10,10 @@ WORKDIR /app
|
||||
# Install system dependencies
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
build-essential \
|
||||
curl \
|
||||
libssl-dev \
|
||||
libffi-dev \
|
||||
build-essential \
|
||||
curl \
|
||||
libssl-dev \
|
||||
libffi-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy requirements and install Python dependencies
|
||||
@@ -34,10 +34,10 @@ ENV PYTHONPATH="/app/src:$PYTHONPATH"
|
||||
# Expose port
|
||||
EXPOSE 8008
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||
# Health check - allow more time for service initialization
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=120s --retries=5 \
|
||||
CMD curl -f http://localhost:8008/health || exit 1
|
||||
|
||||
# Start the application from src directory
|
||||
WORKDIR /app/src
|
||||
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8008"]
|
||||
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8008"]
|
||||
|
||||
Reference in New Issue
Block a user