Skip to content

Commit 078dd60

Browse files
committed
Trimmed down Dockerfile
1 parent da2d99a commit 078dd60

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

batch_processor_filter/Dockerfile

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,16 @@
11
FROM public.ecr.aws/lambda/python:3.11 AS base
22

3-
# Create non-root user
43
RUN mkdir -p /home/appuser && \
54
echo 'appuser:x:1001:1001::/home/appuser:/sbin/nologin' >> /etc/passwd && \
65
echo 'appuser:x:1001:' >> /etc/group && \
7-
chown -R 1001:1001 /home/appuser && pip install "poetry~=2.1.4"
6+
chown -R 1001:1001 /home/appuser && pip install "poetry~=2.1.4"
87

9-
# Install Poetry as root
10-
COPY poetry.lock pyproject.toml ./
8+
COPY poetry.lock pyproject.toml README.md ./
119
RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi --no-root --only main
12-
# -----------------------------
13-
FROM base AS test
14-
COPY src src
15-
COPY tests tests
16-
RUN poetry install --no-interaction --no-ansi --no-root && \
17-
pytest --disable-warnings tests
18-
1910
# -----------------------------
2011
FROM base AS build
2112
COPY src .
2213
RUN chmod 644 $(find . -type f) && chmod 755 $(find . -type d)
23-
# Build as non-root user
14+
# Switch to the non-root user for running the container
2415
USER 1001:1001
2516
CMD ["lambda_handler.lambda_handler"]

filenameprocessor/src/file_name_processor.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ def lambda_handler(event: dict, context) -> None: # pylint: disable=unused-argu
162162
"""Lambda handler for filenameprocessor lambda. Processes each record in event records."""
163163

164164
logger.info("Filename processor lambda task started")
165+
165166
for record in event["Records"]:
166167
handle_record(record)
167168

0 commit comments

Comments
 (0)