Major Changes: - Migrated from prototype to production architecture - Implemented modular Flask app with models/services/web layers - Added Docker containerization with docker-compose - Switched to Pipenv for dependency management - Built advanced parser extracting 63 real activities from INDEX_MASTER - Implemented SQLite FTS5 full-text search - Created minimalist, responsive web interface - Added comprehensive documentation and deployment guides Technical Improvements: - Clean separation of concerns (models, services, web) - Enhanced database schema with FTS5 indexing - Dynamic filters populated from real data - Production-ready configuration management - Security best practices implementation - Health monitoring and API endpoints Removed Legacy Files: - Old src/ directory structure - Static requirements.txt (replaced by Pipfile) - Test and debug files - Temporary cache files Current Status: - 63 activities indexed across 8 categories - Full-text search operational - Docker deployment ready - Production documentation complete 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
69 lines
1.6 KiB
Docker
69 lines
1.6 KiB
Docker
# Multi-stage Dockerfile for INDEX-SISTEM-JOCURI v2.0
|
|
FROM python:3.11-slim as builder
|
|
|
|
# Set build arguments
|
|
ARG DEBIAN_FRONTEND=noninteractive
|
|
|
|
# Install system dependencies for building
|
|
RUN apt-get update && apt-get install -y \
|
|
build-essential \
|
|
curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install pipenv
|
|
RUN pip install --no-cache-dir pipenv
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy Pipfile and Pipfile.lock
|
|
COPY Pipfile Pipfile.lock ./
|
|
|
|
# Install Python dependencies
|
|
RUN pipenv install --system --deploy --ignore-pipfile
|
|
|
|
# Production stage
|
|
FROM python:3.11-slim as production
|
|
|
|
# Set environment variables
|
|
ENV PYTHONUNBUFFERED=1
|
|
ENV FLASK_ENV=production
|
|
ENV FLASK_HOST=0.0.0.0
|
|
ENV FLASK_PORT=5000
|
|
|
|
# Create non-root user for security
|
|
RUN groupadd -r appuser && useradd -r -g appuser appuser
|
|
|
|
# Install runtime dependencies
|
|
RUN apt-get update && apt-get install -y \
|
|
curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy Python dependencies from builder
|
|
COPY --from=builder /usr/local/lib/python3.11/site-packages /usr/local/lib/python3.11/site-packages
|
|
COPY --from=builder /usr/local/bin /usr/local/bin
|
|
|
|
# Copy application code
|
|
COPY app/ ./app/
|
|
COPY data/ ./data/
|
|
COPY scripts/ ./scripts/
|
|
|
|
# Create necessary directories and set permissions
|
|
RUN mkdir -p /app/data /app/logs && \
|
|
chown -R appuser:appuser /app
|
|
|
|
# Switch to non-root user
|
|
USER appuser
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
|
CMD curl -f http://localhost:${FLASK_PORT}/health || exit 1
|
|
|
|
# Expose port
|
|
EXPOSE 5000
|
|
|
|
# Default command
|
|
CMD ["python", "-m", "app.main"] |