@@ -6,15 +6,37 @@ RUN mkdir -p /home/appuser && \
66 echo 'appuser:x:1001:' >> /etc/group && \
77 chown -R 1001:1001 /home/appuser && pip install "poetry~=1.5.0"
88
9- # Install Poetry as root
10- COPY poetry.lock pyproject.toml README.md ./
9+ # Install Poetry dependencies
10+ # Copy shared Poetry files first
11+ COPY shared/poetry.lock shared/pyproject.toml shared/README.md ./shared/
12+ # Copy id_sync Poetry files
13+ COPY id_sync/poetry.lock id_sync/pyproject.toml id_sync/README.md ./
14+
15+ # Install shared dependencies first
16+ WORKDIR /var/task/shared
17+ RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi --no-root --only main
18+
19+ # Install id_sync dependencies
20+ WORKDIR /var/task
1121RUN poetry config virtualenvs.create false && poetry install --no-interaction --no-ansi --no-root --only main
1222
1323# -----------------------------
1424FROM base AS build
15- COPY src .
16- COPY ../shared/src/common ./common
25+
26+ # Set working directory back to Lambda task root
27+ WORKDIR /var/task
28+
29+ # Copy shared source code
30+ COPY shared/src/common ./common
31+
32+ # Copy id_sync source code
33+ COPY id_sync/src .
34+
35+ # Set correct permissions
1736RUN chmod 644 $(find . -type f) && chmod 755 $(find . -type d)
37+
1838# Build as non-root user
1939USER 1001:1001
40+
41+ # Set the Lambda handler
2042CMD ["id_sync.handler" ]
0 commit comments