-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.lambda
More file actions
35 lines (28 loc) · 1.42 KB
/
Copy pathDockerfile.lambda
File metadata and controls
35 lines (28 loc) · 1.42 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
FROM public.ecr.aws/lambda/python:3.12
ENV PYTHONUNBUFFERED=1
WORKDIR ${LAMBDA_TASK_ROOT}
# Install UV from docker image.
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
COPY pyproject.toml uv.lock ./
RUN uv export --frozen --no-dev --no-emit-project --format requirements.txt --output-file requirements.txt \
&& pip install --no-cache-dir --requirement requirements.txt --target "${LAMBDA_TASK_ROOT}" \
&& rm requirements.txt
COPY . .
# ---------------------------------------------------------------------------
# Required environment variables – set these in the Lambda function config
# (AWS Console → Configuration → Environment variables, or via IaC/SAM/CDK).
#
# AUTH_TOKEN – X-API-KEY shared secret for request auth
# POSTGRES_HOST – RDS host
# POSTGRES_PORT – RDS port (default 5432)
# POSTGRES_USER – RDS username
# POSTGRES_PASSWORD – RDS password
# POSTGRES_DB – RDS database name
# AWS_SQS_QUEUE_NAME – SQS queue name (e.g. Coderunr_queue_1.fifo)
# AWS_SQS_QUEUE_URL – Full SQS queue URL
# AWS_REGION – AWS region (e.g. ap-south-1)
#
# AWS credentials (ACCESS_KEY_ID / SECRET_ACCESS_KEY) should NOT be set here;
# attach an IAM execution role to the Lambda function instead.
# ---------------------------------------------------------------------------
CMD ["lambda_handler.handler"]