FROM python:3.11-slim-bookworm ENV PYTHONUNBUFFERED=1 \ DEBIAN_FRONTEND=noninteractive \ ICD_QUICKUMLS_DATA_DIR=/app/quickumls_data \ ICD_MRCONSO_CLINICAL_PARQUET=/app/data/processed/graph/mrconso_clinical.parquet RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ python3-dev \ unzip \ curl \ && curl -fsSL "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o /tmp/awscliv2.zip \ && unzip -q /tmp/awscliv2.zip -d /tmp \ && /tmp/aws/install \ && rm -rf /tmp/aws /tmp/awscliv2.zip \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY requirements-quickumls.txt requirements-space.txt ./ RUN pip install --no-cache-dir -r requirements-quickumls.txt \ && pip install --no-cache-dir -r requirements-space.txt COPY config/ config/ COPY src/ src/ COPY scripts/ scripts/ COPY data/ data/ COPY app.py space_service.py space_entrypoint.sh ./ RUN chmod +x space_entrypoint.sh EXPOSE 7860 CMD ["./space_entrypoint.sh"]