2024-11-03 15:40:24 -08:00
|
|
|
FROM public.ecr.aws/docker/library/python:3.12.0-slim-bullseye
|
2025-02-11 02:09:51 -06:00
|
|
|
COPY --from=public.ecr.aws/awsguru/aws-lambda-adapter:0.8.4 /lambda-adapter /opt/extensions/lambda-adapter
|
2024-11-14 15:15:03 -06:00
|
|
|
ARG APP_DIR
|
2024-11-18 21:49:25 -06:00
|
|
|
ARG WITH_LOCAL_DEPS
|
2024-11-03 15:40:24 -08:00
|
|
|
|
|
|
|
|
ENV POETRY_VIRTUALENVS_CREATE=false
|
|
|
|
|
|
2025-02-20 11:11:05 -08:00
|
|
|
# Install system dependencies including newer sqlite3
|
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
|
|
|
build-essential \
|
|
|
|
|
wget \
|
|
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
|
|
|
&& wget https://www.sqlite.org/2024/sqlite-autoconf-3450000.tar.gz \
|
|
|
|
|
&& tar xvfz sqlite-autoconf-3450000.tar.gz \
|
|
|
|
|
&& cd sqlite-autoconf-3450000 \
|
|
|
|
|
&& ./configure \
|
|
|
|
|
&& make \
|
|
|
|
|
&& make install \
|
|
|
|
|
&& cd .. \
|
|
|
|
|
&& rm -rf sqlite-autoconf-3450000*
|
|
|
|
|
|
|
|
|
|
# Install poetry and configure it
|
2024-12-05 10:01:46 -06:00
|
|
|
RUN pip install poetry==1.7.1 && \
|
2024-11-15 18:30:16 -06:00
|
|
|
poetry config virtualenvs.create false
|
2024-11-12 20:29:55 -06:00
|
|
|
|
2024-11-15 18:30:16 -06:00
|
|
|
# Copy only poetry files first
|
2024-11-14 15:15:03 -06:00
|
|
|
COPY ${APP_DIR}/pyproject.toml ${APP_DIR}/poetry.lock ./
|
2024-11-12 20:29:55 -06:00
|
|
|
|
2024-11-15 18:30:16 -06:00
|
|
|
# Copy SDK and install dependencies in a single layer
|
|
|
|
|
COPY sdk-python/ /opt/sdk-python
|
|
|
|
|
WORKDIR /asset
|
2024-11-18 21:49:25 -06:00
|
|
|
RUN poetry install --no-interaction --no-ansi
|
|
|
|
|
RUN if [ "$WITH_LOCAL_DEPS" = "true" ]; then poetry add /opt/sdk-python; fi
|
2024-11-03 15:40:24 -08:00
|
|
|
|
2024-11-15 18:30:16 -06:00
|
|
|
# Copy application code last
|
2024-11-14 15:15:03 -06:00
|
|
|
COPY ${APP_DIR}/ ./
|
2024-11-03 15:40:24 -08:00
|
|
|
|
2024-11-27 13:31:58 +01:00
|
|
|
RUN mkdir .langgraph_api
|
|
|
|
|
|
2024-11-03 15:40:24 -08:00
|
|
|
CMD ["poetry", "run", "demo"]
|