ML/deployment/Dockerfile.monitoring.lambda
2023-10-17 23:52:51 +00:00

29 lines
1,004 B
Text

FROM public.ecr.aws/lambda/python:3.10
# Set the working directory
WORKDIR ${LAMBDA_TASK_ROOT}
ENV PYTHONPATH "${PYTHONPATH}:${LAMBDA_TASK_ROOT}"
# Environment variables
ARG RUNTIME_ENVIRONMENT
ENV RUNTIME_ENVIRONMENT=${RUNTIME_ENVIRONMENT}
# Install necessary build tools - required to test locally
RUN yum install -y gcc python3-devel
# Install python packages
COPY modules/ml-pipeline/src/pipeline/requirements/predictions/requirements.txt ./predictions_requirements.txt
COPY modules/ml-monitoring/src/evidently/src/requirements/requirements.txt ./monitoring_requirements.txt
RUN pip install --no-cache-dir -r ./predictions_requirements.txt -r ./monitoring_requirements.txt
# Copy the project code
COPY modules/ml-pipeline/src/pipeline ./pipeline
# Copy the monitoring code
COPY modules/ml-monitoring/src/evidently/src ./monitoring
# Copy the handler
COPY deployment/handlers/monitoring_app.py ./pipeline/monitoring_app.py
WORKDIR ${LAMBDA_TASK_ROOT}/pipeline
CMD [ "monitoring_app.handler" ]