-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.lambda
More file actions
34 lines (26 loc) · 910 Bytes
/
Copy pathDockerfile.lambda
File metadata and controls
34 lines (26 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Lambda Container Image for Melanoma Prediction
# Based on AWS Lambda Python 3.12 base image (Amazon Linux 2023)
FROM public.ecr.aws/lambda/python:3.12
# Install system dependencies
RUN dnf install -y \
gcc \
libjpeg-turbo-devel \
zlib-devel \
libgomp \
&& dnf clean all
# Set working directory
WORKDIR ${LAMBDA_TASK_ROOT}
# Install Python dependencies from the pinned lock file
COPY requirements.lock ./
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.lock && \
rm -rf /root/.cache/pip
# Copy application code
COPY ml_model_serving/ ${LAMBDA_TASK_ROOT}/ml_model_serving/
COPY handler.py ${LAMBDA_TASK_ROOT}/
# Copy the trained model
COPY cnn-models/ ${LAMBDA_TASK_ROOT}/cnn-models/
# Set model path environment variable
ENV MODEL_PATH=${LAMBDA_TASK_ROOT}/cnn-models/xception/1/
# Set the Lambda handler
CMD ["handler.predict"]