-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (40 loc) · 1.27 KB
/
Dockerfile
File metadata and controls
50 lines (40 loc) · 1.27 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
FROM public.ecr.aws/lambda/python:3.13
# Install system dependencies
# Removido dnf update para evitar conflitos de versão
# Removido curl pois já está disponível na imagem base
# Adicionado tar necessário para o instalador do UV
RUN dnf install -y \
freetype-devel \
libjpeg-turbo-devel \
zlib-devel \
gcc \
make \
python3-devel \
fontconfig \
ca-certificates \
tar && \
dnf clean all
# Download the latest UV installer
ADD https://astral.sh/uv/install.sh /uv-installer.sh
# Run the installer then remove it
RUN sh /uv-installer.sh && rm /uv-installer.sh
# Ensure the installed binary is on the PATH
ENV PATH="/root/.local/bin/:$PATH"
# Set working directory
WORKDIR ${LAMBDA_TASK_ROOT}
# Copy project configuration files for UV
COPY pyproject.toml .
COPY uv.lock .
# Install dependencies globally using UV
# Export dependencies to requirements.txt and install them globally
RUN uv export --format requirements.txt > requirements.txt && \
uv pip install --system -r requirements.txt
# Copy the entire application
COPY . .
# 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" ]