# Use Python 3.10 slim image FROM python:3.10-slim # Set working directory WORKDIR /app # Install system dependencies RUN apt-get update && apt-get install -y \ ncbi-blast+ \ git \ build-essential \ && rm -rf /var/lib/apt/lists/* # Copy requirements COPY requirements.txt . # Install Python dependencies RUN pip install --no-cache-dir -r requirements.txt # ========================================================= # APPLICATION # ========================================================= COPY app.py . # ========================================================= # FRONTEND # ========================================================= COPY static/ ./static/ COPY templates/ ./templates/ # ========================================================= # MACHINE LEARNING MODELS # ========================================================= COPY label_encoder.pkl . COPY best_model_LR.sav . # ========================================================= # BLAST DATABASE # ========================================================= COPY pathway_db.pdb . COPY pathway_db.phr . COPY pathway_db.pin . COPY pathway_db.pot . COPY pathway_db.psq . COPY pathway_db.ptf . COPY pathway_db.pto . # ========================================================= # PATHWAY MAPPING # ========================================================= COPY pathway_map.csv . # ========================================================= # TEMPORARY DIRECTORIES # ========================================================= RUN mkdir -p /app/data /app/temp /app/uploads # ========================================================= # PORT # ========================================================= EXPOSE 7860 # ========================================================= # HEALTH CHECK # ========================================================= HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \ CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:7860').read()" # ========================================================= # START # ========================================================= CMD ["python", "app.py"]