-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (29 loc) · 797 Bytes
/
Dockerfile
File metadata and controls
36 lines (29 loc) · 797 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
35
36
FROM public.ecr.aws/lambda/python:3.13
# Install system dependencies
RUN dnf update -y && \
dnf install -y \
freetype-devel \
libjpeg-turbo-devel \
zlib-devel \
gcc \
make \
python3-devel \
fontconfig && \
dnf clean all
# Set working directory
WORKDIR ${LAMBDA_TASK_ROOT}
# Copy requirements first to leverage Docker cache
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the entire application
COPY . .
# Create necessary directories
RUN mkdir -p /tmp/certificates && \
chmod 777 /tmp/certificates
# Set environment variables
ENV PYTHONPATH=${LAMBDA_TASK_ROOT}
ENV FONTCONFIG_PATH=/etc/fonts
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Set the CMD to your handler
CMD [ "lambda_function.lambda_handler" ]