-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
24 lines (17 loc) · 779 Bytes
/
Dockerfile
File metadata and controls
24 lines (17 loc) · 779 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
FROM public.ecr.aws/lambda/python:3.10
# Install git (using yum for Amazon Linux)
RUN yum update -y && yum install -y git
# Copy requirements.txt and install the dependencies
COPY requirements.txt ${LAMBDA_TASK_ROOT}
RUN pip install -r requirements.txt
# Create a directory to cache the CLIP model
RUN mkdir -p /model_cache/clip
# Pre-download the CLIP model into /model_cache/clip
RUN python -c "import clip; clip.load('ViT-B/32', download_root='/model_cache/clip')"
# Set an environment variable so the Lambda function uses the pre-downloaded model
ENV CLIP_DOWNLOAD_ROOT=/model_cache/clip
# Copy .env file and function code
COPY .env ${LAMBDA_TASK_ROOT}
COPY lambda_function.py ${LAMBDA_TASK_ROOT}
# Set the CMD to your handler
CMD [ "lambda_function.lambda_handler" ]