Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

Revert "chore: set `Dockerfile` to use Python 3.12 " (#2236)

Sarah Woodersd0edb085afd3
diff --git a/Dockerfile b/Dockerfile
index 553b0b670..42ee3d37b 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,37 +1,17 @@
# Start with pgvector base for builder
FROM ankane/pgvector:v0.5.1 AS builder
-# Install dependencies and Python 3.12
+# Install Python and required packages
RUN apt-get update && apt-get install -y \
- wget \
+ python3 \
+ python3-venv \
+ python3-pip \
+ python3-full \
build-essential \
- libssl-dev \
- zlib1g-dev \
- libncurses5-dev \
- libncursesw5-dev \
- libreadline-dev \
- libsqlite3-dev \
- libgdbm-dev \
- libdb5.3-dev \
- libbz2-dev \
- libexpat1-dev \
- liblzma-dev \
- libffi-dev \
libpq-dev \
+ python3-dev \
&& rm -rf /var/lib/apt/lists/*
-# Download and install Python 3.12
-RUN wget https://www.python.org/ftp/python/3.12.0/Python-3.12.0.tgz \
- && tar xzf Python-3.12.0.tgz \
- && cd Python-3.12.0 \
- && ./configure --enable-optimizations \
- && make -j $(nproc) \
- && make altinstall \
- && cd .. \
- && rm -rf Python-3.12.0 Python-3.12.0.tgz \
- && ln -s /usr/local/bin/python3.12 /usr/local/bin/python3 \
- && ln -s /usr/local/bin/pip3.12 /usr/local/bin/pip3
-
ARG LETTA_ENVIRONMENT=PRODUCTION
ENV LETTA_ENVIRONMENT=${LETTA_ENVIRONMENT} \
POETRY_NO_INTERACTION=1 \
@@ -42,15 +22,14 @@ ENV LETTA_ENVIRONMENT=${LETTA_ENVIRONMENT} \
WORKDIR /app
# Create and activate virtual environment
-RUN python3.12 -m venv /opt/venv
+RUN python3 -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
-# Install poetry in the virtual environment
-RUN pip3 install --no-cache-dir poetry==1.8.2
+# Now install poetry in the virtual environment
+RUN pip install --no-cache-dir poetry==1.8.2
# Copy dependency files first
COPY pyproject.toml poetry.lock ./
-
# Then copy the rest of the application code
COPY . .
@@ -61,34 +40,11 @@ RUN poetry lock --no-update && \
# Runtime stage
FROM ankane/pgvector:v0.5.1 AS runtime
-# Install Python 3.12 dependencies in runtime stage
+# Install Python packages
RUN apt-get update && apt-get install -y \
- wget \
- build-essential \
- libssl-dev \
- zlib1g-dev \
- libncurses5-dev \
- libncursesw5-dev \
- libreadline-dev \
- libsqlite3-dev \
- libgdbm-dev \
- libdb5.3-dev \
- libbz2-dev \
- libexpat1-dev \
- liblzma-dev \
- libffi-dev \
- && rm -rf /var/lib/apt/lists/*
-
-# Install Python 3.12 in runtime stage
-RUN wget https://www.python.org/ftp/python/3.12.0/Python-3.12.0.tgz \
- && tar xzf Python-3.12.0.tgz \
- && cd Python-3.12.0 \
- && ./configure --enable-optimizations \
- && make -j $(nproc) \
- && make altinstall \
- && cd .. \
- && rm -rf Python-3.12.0 Python-3.12.0.tgz \
- && ln -s /usr/local/bin/python3.12 /usr/local/bin/python3 \
+ python3 \
+ python3-venv \
+ && rm -rf /var/lib/apt/lists/* \
&& mkdir -p /app
ARG LETTA_ENVIRONMENT=PRODUCTION